KNNClassifier should take Input Matrix X (m x n), label vector Y (m x 1), the value of k and Point p (1 x n) to give the label to p according to k nearest neighbours.
from learnemall.knn import KNNClassifier
k = KNNClassifier()
X = np.array([1,2],[2,4],[3,6])
Y = np.array([1,2,3])
p = np.array([0,0])
print(k.classify(X,Y,p,k=1)
output:
1
KNNClassifiershould take Input MatrixX(m x n), label vectorY(m x 1), the value ofkand Pointp(1 x n) to give the label topaccording to k nearest neighbours.output:
1