KNNClassifier

class nimble.learners.KNNClassifier

K-Nearest Neighbors Classifier using euclidean distance.

Attributes

learnerType

Describe the type of the learner.

Methods

apply(testX)

Apply the learner to the testing data.

getApplyDefaults()

Class method used to determine the default values of only the apply method.

getApplyParameters()

Class method used to determine the parameters of only the apply method.

getLearnerDefaultValues()

Class method used by the a custom learner interface to supply learner parameter default values to the user through the standard nimble functions.

getLearnerParameterNames()

Class method used by the a custom learner interface to supply learner parameters to the user through the standard nimble functions.

getScores(testX)

If this learner is a classifier, then return the scores for each class on each data point, otherwise raise an exception.

getTrainDefaults()

Class method used to determine the default values of only the train method.

getTrainParameters()

Class method used to determine the parameters of only the train method.

incrementalTrain(trainX, trainY)

Train or continue training the learner on new training data.

train(trainX, trainY[, k])

Train the learner on the training data.