Skip to content

get_support_vector_class_svmGetSupportVectorClassSvmGetSupportVectorClassSvmget_support_vector_class_svmT_get_support_vector_class_svm🔗

Short description🔗

get_support_vector_class_svmGetSupportVectorClassSvmGetSupportVectorClassSvmget_support_vector_class_svmT_get_support_vector_class_svm — Return the index of a support vector from a trained support vector machine.

Signature🔗

get_support_vector_class_svm( class_svm SVMHandle, integer IndexSupportVector, out real Index )void GetSupportVectorClassSvm( const HTuple& SVMHandle, const HTuple& IndexSupportVector, HTuple* Index )static void HOperatorSet.GetSupportVectorClassSvm( HTuple SVMHandle, HTuple indexSupportVector, out HTuple index )def get_support_vector_class_svm( svmhandle: HHandle, index_support_vector: int ) -> float

Herror T_get_support_vector_class_svm( const Htuple SVMHandle, const Htuple IndexSupportVector, Htuple* Index )

double HClassSvm::GetSupportVectorClassSvm( Hlong IndexSupportVector ) const

double HClassSvm.GetSupportVectorClassSvm( int indexSupportVector )

Description🔗

The operator get_support_vector_class_svmGetSupportVectorClassSvm maps a support vector of a trained SVM (given in SVMHandleSVMHandlesvmhandle) to the original training data set. The index of the SV is specified with IndexSupportVectorindexSupportVectorindex_support_vector. The index is counted from 0, i.e., IndexSupportVectorindexSupportVectorindex_support_vector must be a number between 0 and NumSupportVectorsnumSupportVectorsnum_support_vectors \(-\) 1, where NumSupportVectorsnumSupportVectorsnum_support_vectors can be determined with get_support_vector_num_class_svmGetSupportVectorNumClassSvm. The index of this SV in the training data is returned in Indexindexindex. This Indexindexindex can be used for a query with get_sample_class_svmGetSampleClassSvm to obtain the feature vectors that become support vectors. get_sample_class_svmGetSampleClassSvm can, for example, be used to visualize the support vectors.

Note that when using train_class_svmTrainClassSvm with a mode different from 'default'"default" or reducing the SVM with reduce_class_svmReduceClassSvm, the returned Indexindexindex will always be -1-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🔗

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🔗

SVMHandleSVMHandlesvmhandle (input_control) class_svm → (handle)HTuple (HHandle)HClassSvm, HTuple (IntPtr)HHandleHtuple (handle)

SVM handle.

IndexSupportVectorindexSupportVectorindex_support_vector (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Index of the stored support vector.

Indexindexindex (output_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Index of the support vector in the training set.

Result🔗

If the parameters are valid the operator get_sample_class_svmGetSampleClassSvm returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

train_class_svmTrainClassSvm, get_support_vector_num_class_svmGetSupportVectorNumClassSvm

Possible successors

get_sample_class_svmGetSampleClassSvm

See also

create_class_svmCreateClassSvm

Module🔗

Foundation