ClassesClasses | | Operators

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

get_support_vector_class_svm( : : SVMHandle, IndexSupportVector : Index)

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

void GetSupportVectorClassSvm(const HTuple& SVMHandle, const HTuple& IndexSupportVector, HTuple* Index)

double HClassSvm::GetSupportVectorClassSvm(const HTuple& IndexSupportVector) const

static void HOperatorSet.GetSupportVectorClassSvm(HTuple SVMHandle, HTuple indexSupportVector, out HTuple index)

double HClassSvm.GetSupportVectorClassSvm(HTuple indexSupportVector)

Description

The operator get_support_vector_class_svmget_support_vector_class_svmGetSupportVectorClassSvmGetSupportVectorClassSvmGetSupportVectorClassSvm maps support vectors 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 IndexSupportVectors - 1, where IndexSupportVectors 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

Parameters

SVMHandleSVMHandleSVMHandleSVMHandleSVMHandle (input_control)  class_svm HClassSvm, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

SVM handle.

IndexSupportVectorIndexSupportVectorIndexSupportVectorIndexSupportVectorindexSupportVector (input_control)  integer-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of stored support vectors.

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


ClassesClasses | | Operators