battelle.knn.KNearestNeighborsClassifier.train

KNearestNeighborsClassifier.train(x, y)

Fit the k-nearest neighbors classifier from the training dataset.

Note

For a k-NN classifier, it only consits of storing the data provided.

Parameters
  • x (array-like of shape (n_samples, n_features)) – Training data

  • y (array-like of shape (n_samples) or (n_samples, n_outputs)) – Target values