get_support_vector_class_svm — Return the index of a support vector from a trained support vector machine.
The operator get_support_vector_class_svm maps a support vector of a trained SVM (given in SVMHandle) to the original training data set. The index of the SV is specified with IndexSupportVector. The index is counted from 0, i.e., IndexSupportVector must be a number between 0 and NumSupportVectors - 1, where NumSupportVectors can be determined with get_support_vector_num_class_svm. The index of this SV in the training data is returned in Index. This Index can be used for a query with get_sample_class_svm to obtain the feature vectors that become support vectors. get_sample_class_svm can, for example, be used to visualize the support vectors.
Note that when using train_class_svm with a mode different from 'default' or reducing the SVM with reduce_class_svm, the returned Index will always be -1, i.e., it will be invalid. The reason for this is that a consistent mapping between SV and training data becomes impossible.
Index of the stored support vector.
Index of the support vector in the training set.
If the parameters are valid the operator get_sample_class_svm returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.