GestureRecognitionToolkit  Version: 1.0 Revision: 04-03-15
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
KNN.h File Reference

This class implements the K-Nearest Neighbor classification algorithm (http://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm). KNN is a simple but powerful classifier, based on finding the closest K training examples in the feature space for the new input vector. The KNN algorithm is amongst the simplest of all machine learning algorithms: an object is classified by a majority vote of its neighbors, with the object being assigned to the class most common amongst its k nearest neighbors (k is a positive integer, typically small). If k = 1, then the object is simply assigned to the class of its nearest neighbor. More...

Go to the source code of this file.

Classes

class  GRT::KNN
 

Namespaces

 GRT
 

Macros

#define BIG_DISTANCE   99e+99
 

Detailed Description

This class implements the K-Nearest Neighbor classification algorithm (http://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm). KNN is a simple but powerful classifier, based on finding the closest K training examples in the feature space for the new input vector. The KNN algorithm is amongst the simplest of all machine learning algorithms: an object is classified by a majority vote of its neighbors, with the object being assigned to the class most common amongst its k nearest neighbors (k is a positive integer, typically small). If k = 1, then the object is simply assigned to the class of its nearest neighbor.

Author
Nicholas Gillian ngill.nosp@m.ian@.nosp@m.media.nosp@m..mit.nosp@m..edu
Version
1.0

This implementation of the algorithm will return the class label of the class that gains the majoriy vote of its neighbours. If the average distance of the closest K neighbors with the class label of the majority vote is greater than that of that classes rejection threshold, then the predicted class label will be set to 0, indicating that the majority class was rejected. This feature can be enabled or disabled by setting the enableNullRejection paramter to false.

Definition in file KNN.h.