Home | Trees | Indices | Help |
|
---|
|
k-Nearest-Neighbour classifier.
This is a simple classifier that bases its decision on the distances
between the training dataset samples and the test sample(s). Distances
are computed using a customizable distance function. A certain number
(k
)of nearest neighbors is selected based on the smallest distances
and the labels of this neighboring samples are fed into a voting
function to determine the labels of the test sample.
Training a kNN classifier is extremely quick, as no actuall training is performed as the training dataset is simply stored in the classifier. All computations are done during classifier prediction.
If enabled, kNN stores the votes per class in the 'values' state after calling predict().
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|||
_clf_internals = ['knn', 'non-linear', 'binary', 'multiclass', Describes some specifics about the classifier -- is that it is doing regression for instance.... |
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
Parameters:
|
|
|
Train the classifier. For kNN it is degenerate -- just stores the data.
|
Predict the class labels for the provided data. Returns a list of class labels (one for each data sample).
|
|
|
_clf_internalsDescribes some specifics about the classifier -- is that it is doing regression for instance....
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Apr 23 23:09:19 2012 | http://epydoc.sourceforge.net |