GestureRecognitionToolkit
Version: 0.2.5
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
|
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.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.