CKNN Class Reference

Detailed Description

Class KNN, an implementation of the standard k-nearest neigbor classifier.

An example is classified to belong to the class of which the majority of the k closest examples belong to. Formally, kNN is described as

This class provides a capability to do weighted classfication using:

where .

To avoid ties, k should be an odd number. To define how close examples are k-NN requires a CDistance object to work with (e.g., CEuclideanDistance ).

Note that k-NN has zero training time but classification times increase dramatically with the number of examples. Also note that k-NN is capable of multi-class-classification. And finally, in case of k=1 classification will take less time with an special optimization provided.