get_prep_info_class_svmT_get_prep_info_class_svmGetPrepInfoClassSvmGetPrepInfoClassSvm (Operator)

Name

get_prep_info_class_svmT_get_prep_info_class_svmGetPrepInfoClassSvmGetPrepInfoClassSvm — Berechnen des Informationsgehaltes der vorverarbeiteten Merkmalsvektoren einer Support-Vektor-Maschine.

Signatur

get_prep_info_class_svm( : : SVMHandle, Preprocessing : InformationCont, CumInformationCont)

Herror T_get_prep_info_class_svm(const Htuple SVMHandle, const Htuple Preprocessing, Htuple* InformationCont, Htuple* CumInformationCont)

void GetPrepInfoClassSvm(const HTuple& SVMHandle, const HTuple& Preprocessing, HTuple* InformationCont, HTuple* CumInformationCont)

HTuple HClassSvm::GetPrepInfoClassSvm(const HString& Preprocessing, HTuple* CumInformationCont) const

HTuple HClassSvm::GetPrepInfoClassSvm(const char* Preprocessing, HTuple* CumInformationCont) const

HTuple HClassSvm::GetPrepInfoClassSvm(const wchar_t* Preprocessing, HTuple* CumInformationCont) const   (Nur Windows)

static void HOperatorSet.GetPrepInfoClassSvm(HTuple SVMHandle, HTuple preprocessing, out HTuple informationCont, out HTuple cumInformationCont)

HTuple HClassSvm.GetPrepInfoClassSvm(string preprocessing, out HTuple cumInformationCont)

Beschreibung

get_prep_info_class_svmget_prep_info_class_svmGetPrepInfoClassSvmGetPrepInfoClassSvmGetPrepInfoClassSvm berechnet den Informationsgehalt der mit der durch PreprocessingPreprocessingPreprocessingPreprocessingpreprocessing gegebenen Vorverarbeitung transformierten Komponenten der Trainingsvektoren. PreprocessingPreprocessingPreprocessingPreprocessingpreprocessing kann auf 'principal_components'"principal_components""principal_components""principal_components""principal_components" oder 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates" gesetzt werden. Die zu Grunde liegenden Vorverarbeitungen sind bei create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm beschrieben. Der Informationsgehalt wird aus die Variation der transformierten Komponenten der Trainingsvektoren berechnet, d.h. er wird rein aufgrund der Trainingsdaten unabhängig von einer Fehlerrate bei einer Klassifikation der Trainingsdaten berechnet. Der Informationsgehalt wird für alle relevanten Komponenten der transformierten Merkmalsvektoren (NumFeatures für 'principal_components'"principal_components""principal_components""principal_components""principal_components" und min(NumClasses - 1, NumFeatures) für 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates", siehe create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm) in InformationContInformationContInformationContInformationContinformationCont zurückgegeben. Der Informationsgehalt wird als eine Zahl zwischen 0 und 1 dargestellt. Ein prozentualer Informationsgehalt kann leicht durch Multiplikation mit 100 berechnet werden. Der kumulierte Informationsgehalt der ersten n Komponenten wird in der n-ten Komponente von CumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont zurückgegeben, d.h. CumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont enthält die Summen der ersten n Elemente von InformationContInformationContInformationContInformationContinformationCont. Um get_prep_info_class_svmget_prep_info_class_svmGetPrepInfoClassSvmGetPrepInfoClassSvmGetPrepInfoClassSvm verwenden zu können, müssen mit add_sample_class_svmadd_sample_class_svmAddSampleClassSvmAddSampleClassSvmAddSampleClassSvm oder read_samples_class_svmread_samples_class_svmReadSamplesClassSvmReadSamplesClassSvmReadSamplesClassSvm genügend viele Trainingsmuster zu der durch SVMHandleSVMHandleSVMHandleSVMHandleSVMHandle gegebenen SVM hinzugefügt werden.

InformationContInformationContInformationContInformationContinformationCont und CumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont können dazu verwendet werden, um zu entscheiden, wie viele Komponenten der transformierten Merkmalsvektoren relevante Information enthalten. Ein oft verwendetes Kriterium ist z.B. zu verlangen, dass die transformierten Daten x% (z.B. 90%) der Daten enthalten sollten. Dies kann leicht anhand des ersten Wertes von CumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont, der über x% liegt, bestimmt werden. Der so erhaltene Wert kann bei einem neuerlichen Aufruf von create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm als NumComponents verwendet werden. Da zum Aufruf von get_prep_info_class_svmget_prep_info_class_svmGetPrepInfoClassSvmGetPrepInfoClassSvmGetPrepInfoClassSvm schon eine SVM mit create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm erzeugt werden muss, also auch ein initialer Wert von NumComponents bei create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm angegeben werden muss, aber bei Verwendung von get_prep_info_class_svmget_prep_info_class_svmGetPrepInfoClassSvmGetPrepInfoClassSvmGetPrepInfoClassSvm typischerweise noch nicht bekannt ist, wie viele Komponenten relevant sind, empfiehlt sich folgendes zweistufiges Vorgehen, um NumComponents zu bestimmen: In einem ersten Schritt wird eine SVM mit der maximalen Anzahl von NumComponents (NumFeatures für 'principal_components'"principal_components""principal_components""principal_components""principal_components" und min(NumClasses - 1, NumFeatures) für 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates") erzeugt. Dann werden die Trainingsmuster zu der SVM hinzugefügt und mit write_samples_class_svmwrite_samples_class_svmWriteSamplesClassSvmWriteSamplesClassSvmWriteSamplesClassSvm in eine Datei gespeichert. Anschließend wird mit get_prep_info_class_svmget_prep_info_class_svmGetPrepInfoClassSvmGetPrepInfoClassSvmGetPrepInfoClassSvm der Informationsgehalt der Komponenten und somit NumComponents bestimmt. Danach wird eine neue SVM mit der gewünschten Anzahl Komponenten erzeugt, und die abgespeicherten Trainingsdaten mit read_samples_class_svmread_samples_class_svmReadSamplesClassSvmReadSamplesClassSvmReadSamplesClassSvm wieder eingelesen. Hierauf wird die SVM mit train_class_svmtrain_class_svmTrainClassSvmTrainClassSvmTrainClassSvm trainiert.

Ausführungsinformationen

Parameter

SVMHandleSVMHandleSVMHandleSVMHandleSVMHandle (input_control)  class_svm HClassSvm, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle der SVM.

PreprocessingPreprocessingPreprocessingPreprocessingpreprocessing (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Art der Vorverarbeitung (Transformation) der Merkmalsvektoren.

Defaultwert: 'principal_components' "principal_components" "principal_components" "principal_components" "principal_components"

Werteliste: 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates", 'principal_components'"principal_components""principal_components""principal_components""principal_components"

InformationContInformationContInformationContInformationContinformationCont (output_control)  real-array HTupleHTupleHtuple (real) (double) (double) (double)

Relativer Informationsgehalt der transformierten Merkmalsvektoren.

CumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont (output_control)  real-array HTupleHTupleHtuple (real) (double) (double) (double)

Kumulierter Informationsgehalt der transformierten Merkmalsvektoren.

Beispiel (HDevelop)

* Create the initial SVM
create_class_svm (NumFeatures, 'rbf', 0.01, 0.01, NumClasses,\
                  'one-versus-all', 'normalization', NumFeatures,\
                  SVMHandle)
* Generate and add the training data
for J := 0 to NumData-1 by 1
    * Generate training features and classes
    * Data = [...]
    * Class = ...
    add_sample_class_svm (SVMHandle, Data, Class)
endfor
write_samples_class_svm (SVMHandle, 'samples.mtf')
* Compute the information content of the transformed features
get_prep_info_class_svm (SVMHandle, 'principal_components',\
                         InformationCont, CumInformationCont)
* Determine NumComp by inspecting InformationCont and CumInformationCont
* NumComp = [...]
* Create the actual SVM
create_class_svm (NumFeatures, 'rbf', 0.01, 0.01, NumClasses, \
                  'one-versus-all', 'principal_components', \
                  NumComp, SVMHandle)
* Train the SVM
read_samples_class_svm (SVMHandle, 'samples.mtf')
train_class_svm (SVMHandle, 0.001, 'default')
write_class_svm (SVMHandle, 'classifier.svm')

Ergebnis

Sind die Parameterwerte korrekt, dann liefert get_prep_info_class_svmget_prep_info_class_svmGetPrepInfoClassSvmGetPrepInfoClassSvmGetPrepInfoClassSvm den Wert 2 (H_MSG_TRUE). Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Falls get_prep_info_class_svmget_prep_info_class_svmGetPrepInfoClassSvmGetPrepInfoClassSvmGetPrepInfoClassSvm den Fehler 9211 (Matrix ist nicht positiv definit) bei PreprocessingPreprocessingPreprocessingPreprocessingpreprocessing = 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates" zurückliefert, bedeutet dies typischerweise, dass für die verschiedenen Klassen zu wenige Trainingsmuster gespeichert worden sind.

Vorgänger

add_sample_class_svmadd_sample_class_svmAddSampleClassSvmAddSampleClassSvmAddSampleClassSvm, read_samples_class_svmread_samples_class_svmReadSamplesClassSvmReadSamplesClassSvmReadSamplesClassSvm

Nachfolger

clear_class_svmclear_class_svmClearClassSvmClearClassSvmClearClassSvm, create_class_svmcreate_class_svmCreateClassSvmCreateClassSvmCreateClassSvm

Literatur

Christopher M. Bishop: „Neural Networks for Pattern Recognition“; Oxford University Press, Oxford; 1995.
Andrew Webb: „Statistical Pattern Recognition“; Arnold, London; 1999.

Modul

Foundation