I am new to machine learning.
I created a data, random numbers in two sets. I am trying how to find a sample, however when doing following, I receive very low accuracy score:
from random import randint as R from matplotlib import pyplot as plt import numpy as np from sklearn.neighbors import KNeighborsClassifier as KNC from sklearn.cross_validation import train_test_split as tts from sklearn.metrics import accuracy_score a = [R(100,200) for x in range(100)] b = [R(1000,2000) for x in range(100)] c = a+b X = np.array(c).reshape(len(c),1) y = np.arange(len(c)) train_X, test_X, train_y,test_y = tts(X,y,test_size=0.4) mimi = KNC() mimi.fit(train_X, train_y) y__pred = mimi.predict(train_X) print(accuracy_score(train_y,y__pred)) print(mimi.score(train_X,train_y))
I receive a result of 0.18... What exactly does this mean? That a prediction score is just 18%? Please, can you explain to me in most simple way. I would really appreciate it.