Operators |
get_sample_class_knn — Return a training sample from the training data of a k-nearest neighbors (k-NN) classifier.
get_sample_class_knn( : : KNNHandle, IndexSample : Features, ClassID)
get_sample_class_knn reads a training sample from the k-nearest neighbors (k-NN) classifier given by KNNHandle that was added with add_sample_class_knn or read_class_knn. The index of the sample is specified with IndexSample. The index is counted from 0, i.e., IndexSample must be a number between 0 and NumSamples - 1, where NumSamples can be determined with get_sample_num_class_knn. The training sample is returned in Features and ClassID. Features is a feature vector of length NumDim (see create_class_knn), while ClassID is the class label, which is a number between 0 and the number of classes.
Handle of the k-NN classifier.
Index of the training sample.
Feature vector of the training sample.
Class of the training sample.
If the parameters are valid the operator get_sample_class_knn returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
Foundation
Operators |