Name
select_feature_set_svmT_select_feature_set_svmSelectFeatureSetSvmselect_feature_set_svmSelectFeatureSetSvmSelectFeatureSetSvm — Selects an optimal combination of features to classify the provided data.
Herror select_feature_set_svm(const HTuple& ClassTrainDataHandle, const HTuple& SelectionMethod, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* SVMHandle, HTuple* SelectedFeatureIndices, HTuple* Score)
HTuple HClassSvm::SelectFeatureSetSvm(const HClassTrainData& ClassTrainDataHandle, const HTuple& SelectionMethod, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* Score)
HClassSvm HClassTrainData::SelectFeatureSetSvm(const HTuple& SelectionMethod, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* SelectedFeatureIndices, HTuple* Score) const
void SelectFeatureSetSvm(const HTuple& ClassTrainDataHandle, const HTuple& SelectionMethod, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* SVMHandle, HTuple* SelectedFeatureIndices, HTuple* Score)
HTuple HClassSvm::SelectFeatureSetSvm(const HClassTrainData& ClassTrainDataHandle, const HString& SelectionMethod, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* Score)
HTuple HClassSvm::SelectFeatureSetSvm(const HClassTrainData& ClassTrainDataHandle, const HString& SelectionMethod, const HString& GenParamNames, double GenParamValues, HTuple* Score)
HTuple HClassSvm::SelectFeatureSetSvm(const HClassTrainData& ClassTrainDataHandle, const char* SelectionMethod, const char* GenParamNames, double GenParamValues, HTuple* Score)
HClassSvm HClassTrainData::SelectFeatureSetSvm(const HString& SelectionMethod, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* SelectedFeatureIndices, HTuple* Score) const
HClassSvm HClassTrainData::SelectFeatureSetSvm(const HString& SelectionMethod, const HString& GenParamNames, double GenParamValues, HTuple* SelectedFeatureIndices, HTuple* Score) const
HClassSvm HClassTrainData::SelectFeatureSetSvm(const char* SelectionMethod, const char* GenParamNames, double GenParamValues, HTuple* SelectedFeatureIndices, HTuple* Score) const
void HOperatorSetX.SelectFeatureSetSvm(
[in] VARIANT ClassTrainDataHandle, [in] VARIANT SelectionMethod, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* SVMHandle, [out] VARIANT* SelectedFeatureIndices, [out] VARIANT* Score)
VARIANT HClassSvmX.SelectFeatureSetSvm(
[in] IHClassTrainDataX* ClassTrainDataHandle, [in] BSTR SelectionMethod, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* Score)
IHClassSvmX* HClassTrainDataX.SelectFeatureSetSvm(
[in] BSTR SelectionMethod, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* SelectedFeatureIndices, [out] VARIANT* Score)
static void HOperatorSet.SelectFeatureSetSvm(HTuple classTrainDataHandle, HTuple selectionMethod, HTuple genParamNames, HTuple genParamValues, out HTuple SVMHandle, out HTuple selectedFeatureIndices, out HTuple score)
HTuple HClassSvm.SelectFeatureSetSvm(HClassTrainData classTrainDataHandle, string selectionMethod, HTuple genParamNames, HTuple genParamValues, out HTuple score)
HTuple HClassSvm.SelectFeatureSetSvm(HClassTrainData classTrainDataHandle, string selectionMethod, string genParamNames, double genParamValues, out HTuple score)
HClassSvm HClassTrainData.SelectFeatureSetSvm(string selectionMethod, HTuple genParamNames, HTuple genParamValues, out HTuple selectedFeatureIndices, out HTuple score)
HClassSvm HClassTrainData.SelectFeatureSetSvm(string selectionMethod, string genParamNames, double genParamValues, out HTuple selectedFeatureIndices, out HTuple score)
select_feature_set_svmselect_feature_set_svmSelectFeatureSetSvmselect_feature_set_svmSelectFeatureSetSvmSelectFeatureSetSvm selects an optimal subset from a set of
features to solve a given classification problem.
The classification problem has to be specified with annotated training data
in ClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleclassTrainDataHandle and will be classified by a
support vector machine (SVM). Details of the properties of this
classifier can be found in create_class_svmcreate_class_svmCreateClassSvmcreate_class_svmCreateClassSvmCreateClassSvm.
The result of the operator is a trained classifier that is returned in
SVMHandleSVMHandleSVMHandleSVMHandleSVMHandleSVMHandle. Additionally, the list of indices or names of the
selected features
is returned in SelectedFeatureIndicesSelectedFeatureIndicesSelectedFeatureIndicesSelectedFeatureIndicesSelectedFeatureIndicesselectedFeatureIndices. To use this classifier,
calculate for new input data all features mentioned in
SelectedFeatureIndicesSelectedFeatureIndicesSelectedFeatureIndicesSelectedFeatureIndicesSelectedFeatureIndicesselectedFeatureIndices and pass them to the classifier.
A possible application of this operator can be a comparison of
different parameter sets for certain feature extraction techniques. Another
application is to search for a feature that is discriminating between
different classes.
Additionally, the values for 'nu'"nu""nu""nu""nu""nu" and
'gamma'"gamma""gamma""gamma""gamma""gamma" can be estimated for the SVM. To only estimate these
two parameters without altering the feature set,
the feature vector has to be specified as one large subfeature.
To define the features that should be selected from
ClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleclassTrainDataHandle, the dimensions of the
feature vectors in ClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleclassTrainDataHandle can be grouped into
subfeatures by calling set_feature_lengths_class_train_dataset_feature_lengths_class_train_dataSetFeatureLengthsClassTrainDataset_feature_lengths_class_train_dataSetFeatureLengthsClassTrainDataSetFeatureLengthsClassTrainData.
A subfeature can contain several subsequent elements of a feature vector.
The operator decides for each of these subfeatures, if it is better to
use it for the classification or leave it out.
The indices of the selected subfeatures are returned in
SelectedFeatureIndicesSelectedFeatureIndicesSelectedFeatureIndicesSelectedFeatureIndicesSelectedFeatureIndicesselectedFeatureIndices.
If names were set in set_feature_lengths_class_train_dataset_feature_lengths_class_train_dataSetFeatureLengthsClassTrainDataset_feature_lengths_class_train_dataSetFeatureLengthsClassTrainDataSetFeatureLengthsClassTrainData, these
names are returned instead of the indices.
If set_feature_lengths_class_train_dataset_feature_lengths_class_train_dataSetFeatureLengthsClassTrainDataset_feature_lengths_class_train_dataSetFeatureLengthsClassTrainDataSetFeatureLengthsClassTrainData was not called for
ClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleClassTrainDataHandleclassTrainDataHandle before, each element of the feature vector
is considered as a subfeature.
The selection method
SelectionMethodSelectionMethodSelectionMethodSelectionMethodSelectionMethodselectionMethod is either a greedy search 'greedy'"greedy""greedy""greedy""greedy""greedy"
(iteratively add the feature with highest gain)
or the dynamically oscillating search 'greedy_oscillating'"greedy_oscillating""greedy_oscillating""greedy_oscillating""greedy_oscillating""greedy_oscillating"
(add the feature with highest gain and test then if any of the already added
features can be left out without great loss).
The method 'greedy'"greedy""greedy""greedy""greedy""greedy" is generally preferable, since it is faster.
Only in cases when the subfeatures are low-dimensional or redundant,
the method 'greedy_oscillating'"greedy_oscillating""greedy_oscillating""greedy_oscillating""greedy_oscillating""greedy_oscillating" should be chosen.
The optimization criterion is the classification rate of
a two-fold cross-validation of the training data.
The best achieved value is returned in ScoreScoreScoreScoreScorescore.
The parameters 'nu'"nu""nu""nu""nu""nu" and 'gamma'"gamma""gamma""gamma""gamma""gamma" for the SVM that is used
to classify can be set to 'auto'"auto""auto""auto""auto""auto" by using the
parameters GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames and GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues. If they are
set to 'auto'"auto""auto""auto""auto""auto", the estimated optimal 'nu'"nu""nu""nu""nu""nu" and/or
'gamma'"gamma""gamma""gamma""gamma""gamma" is estimated. The automatic estimation of 'nu'"nu""nu""nu""nu""nu"
and 'gamma'"gamma""gamma""gamma""gamma""gamma" can take a substantial amount of time (up to days,
depending on the data set and the number of features).
Additionally, there
is the parameter 'mode'"mode""mode""mode""mode""mode" which can be either set to
'one-versus-all'"one-versus-all""one-versus-all""one-versus-all""one-versus-all""one-versus-all" or 'one-versus-one'"one-versus-one""one-versus-one""one-versus-one""one-versus-one""one-versus-one". An explanation of
the two modes as well as of the parameters 'nu'"nu""nu""nu""nu""nu" and
'gamma'"gamma""gamma""gamma""gamma""gamma" as the kernel parameter of the radial basis function (RBF)
kernel can be found in create_class_svmcreate_class_svmCreateClassSvmcreate_class_svmCreateClassSvmCreateClassSvm.
This operator may take considerable time, depending on the size of the
data set in the training file, and the number of features.
Please note, that this operator should not be called, if only a small
set of training data is available. Due to the risk of overfitting the
operator select_feature_set_svmselect_feature_set_svmSelectFeatureSetSvmselect_feature_set_svmSelectFeatureSetSvmSelectFeatureSetSvm may deliver a classifier with
a very high score. However, the classifier may perfom poorly when tested.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on internal data level.
This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.
Handle of the training data.
Method to perform the selection.
Default value:
'greedy'
"greedy"
"greedy"
"greedy"
"greedy"
"greedy"
List of values: 'greedy'"greedy""greedy""greedy""greedy""greedy", 'greedy_oscillating'"greedy_oscillating""greedy_oscillating""greedy_oscillating""greedy_oscillating""greedy_oscillating"
Names of generic parameters to configure the
selection process and the classifier.
Default value: []
List of values: 'gamma'"gamma""gamma""gamma""gamma""gamma", 'mode'"mode""mode""mode""mode""mode", 'nu'"nu""nu""nu""nu""nu"
Values of generic parameters to configure the
selection process and the classifier.
Default value: []
Suggested values: 0.02, 0.05, 'auto'"auto""auto""auto""auto""auto", 'one-versus-one'"one-versus-one""one-versus-one""one-versus-one""one-versus-one""one-versus-one", 'one-versus-all'"one-versus-all""one-versus-all""one-versus-all""one-versus-all""one-versus-all"
A trained SVM classifier using only the selected
features.
The selected feature set, contains
indices.
The achieved score using two-fold cross-validation.
* Find out which of the two features distinguishes two Classes
NameFeature1 := 'Good Feature'
NameFeature2 := 'Bad Feature'
LengthFeature1 := 3
LengthFeature2 := 2
* Create training data
create_class_train_data (LengthFeature1+LengthFeature2,\
ClassTrainDataHandle)
* Define the features which are in the training data
set_feature_lengths_class_train_data (ClassTrainDataHandle, [LengthFeature1,\
LengthFeature2], [NameFeature1, NameFeature2])
* Add training data
* |Feat1| |Feat2|
add_sample_class_train_data (ClassTrainDataHandle, 'row', [1,1,1, 2,1 ], 0)
add_sample_class_train_data (ClassTrainDataHandle, 'row', [2,2,2, 2,1 ], 1)
add_sample_class_train_data (ClassTrainDataHandle, 'row', [1,1,1, 3,4 ], 0)
add_sample_class_train_data (ClassTrainDataHandle, 'row', [2,2,2, 3,4 ], 1)
* Add more data
* ...
* Select the better feature with a SVM
select_feature_set_svm (ClassTrainDataHandle, 'greedy', [], [], SVMHandle,\
SelectedFeatureSVM, Score)
clear_class_train_data (ClassTrainDataHandle)
* Use the classifier
* ...
clear_class_svm (SVMHandle)
If the parameters are valid, the operator select_feature_set_svmselect_feature_set_svmSelectFeatureSetSvmselect_feature_set_svmSelectFeatureSetSvmSelectFeatureSetSvm
returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
create_class_train_datacreate_class_train_dataCreateClassTrainDatacreate_class_train_dataCreateClassTrainDataCreateClassTrainData,
add_sample_class_train_dataadd_sample_class_train_dataAddSampleClassTrainDataadd_sample_class_train_dataAddSampleClassTrainDataAddSampleClassTrainData,
set_feature_lengths_class_train_dataset_feature_lengths_class_train_dataSetFeatureLengthsClassTrainDataset_feature_lengths_class_train_dataSetFeatureLengthsClassTrainDataSetFeatureLengthsClassTrainData
classify_class_svmclassify_class_svmClassifyClassSvmclassify_class_svmClassifyClassSvmClassifyClassSvm
select_feature_set_mlpselect_feature_set_mlpSelectFeatureSetMlpselect_feature_set_mlpSelectFeatureSetMlpSelectFeatureSetMlp,
select_feature_set_knnselect_feature_set_knnSelectFeatureSetKnnselect_feature_set_knnSelectFeatureSetKnnSelectFeatureSetKnn,
select_feature_set_gmmselect_feature_set_gmmSelectFeatureSetGmmselect_feature_set_gmmSelectFeatureSetGmmSelectFeatureSetGmm
select_feature_set_trainf_svmselect_feature_set_trainf_svmSelectFeatureSetTrainfSvmselect_feature_set_trainf_svmSelectFeatureSetTrainfSvmSelectFeatureSetTrainfSvm,
gray_featuresgray_featuresGrayFeaturesgray_featuresGrayFeaturesGrayFeatures,
region_featuresregion_featuresRegionFeaturesregion_featuresRegionFeaturesRegionFeatures
Foundation