get_support_vector_class_svmT_get_support_vector_class_svmGetSupportVectorClassSvmGetSupportVectorClassSvm (Operator)
Name
get_support_vector_class_svmT_get_support_vector_class_svmGetSupportVectorClassSvmGetSupportVectorClassSvm
— Return the index of a support vector from a trained support vector
machine.
Signature
Description
The operator get_support_vector_class_svmget_support_vector_class_svmGetSupportVectorClassSvmGetSupportVectorClassSvmGetSupportVectorClassSvm
maps a support
vector of a trained SVM (given in SVMHandleSVMHandleSVMHandleSVMHandleSVMHandle
) to the
original training data set. The index of the SV is specified with
IndexSupportVectorIndexSupportVectorIndexSupportVectorIndexSupportVectorindexSupportVector
. The index is counted from 0, i.e.,
IndexSupportVectorIndexSupportVectorIndexSupportVectorIndexSupportVectorindexSupportVector
must be a number between 0 and
NumSupportVectors
- 1, where
NumSupportVectors
can be determined with
get_support_vector_num_class_svmget_support_vector_num_class_svmGetSupportVectorNumClassSvmGetSupportVectorNumClassSvmGetSupportVectorNumClassSvm
. The index of this SV in
the training data is returned in IndexIndexIndexIndexindex
. This
IndexIndexIndexIndexindex
can be used for a query with
get_sample_class_svmget_sample_class_svmGetSampleClassSvmGetSampleClassSvmGetSampleClassSvm
to obtain the feature vectors that
become support vectors. get_sample_class_svmget_sample_class_svmGetSampleClassSvmGetSampleClassSvmGetSampleClassSvm
can, for
example, be used to visualize the support vectors.
Note that when using train_class_svmtrain_class_svmTrainClassSvmTrainClassSvmTrainClassSvm
with a mode different from
'default' or reducing the SVM with reduce_class_svmreduce_class_svmReduceClassSvmReduceClassSvmReduceClassSvm
, the returned
IndexIndexIndexIndexindex
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.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
SVMHandleSVMHandleSVMHandleSVMHandleSVMHandle
(input_control) class_svm →
HClassSvm, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
SVM handle.
IndexSupportVectorIndexSupportVectorIndexSupportVectorIndexSupportVectorindexSupportVector
(input_control) integer →
HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index of the stored support vector.
IndexIndexIndexIndexindex
(output_control) real →
HTupleHTupleHtuple (real) (double) (double) (double)
Index of the support vector in the training set.
Result
If the parameters are valid the operator get_sample_class_svmget_sample_class_svmGetSampleClassSvmGetSampleClassSvmGetSampleClassSvm
returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
Possible Predecessors
train_class_svmtrain_class_svmTrainClassSvmTrainClassSvmTrainClassSvm
,
get_support_vector_num_class_svmget_support_vector_num_class_svmGetSupportVectorNumClassSvmGetSupportVectorNumClassSvmGetSupportVectorNumClassSvm
Possible Successors
get_sample_class_svmget_sample_class_svmGetSampleClassSvmGetSampleClassSvmGetSampleClassSvm
See also
create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm
Module
Foundation