iRoCS Toolbox
1.1.0
|
#include <BasicCVAdapter.hh>
Public Types | |
typedef FV | FV_TYPE |
typedef PROBLEM | PROBLEM_TYPE |
Public Member Functions | |
virtual | ~BasicCVAdapter () |
virtual double | classificationDelta () const =0 |
virtual const std::vector< StDataASCII > & | classificationDetailsByUID () const =0 |
get classification details for each uid from last full CV or parital CV. More... | |
virtual void | clearKernelCache ()=0 |
call clearKernelCache() of selected svm. More... | |
virtual int | doFullCV (const std::vector< int > &subsetIndexByUID, std::vector< double > &predictedClassLabelByUID)=0 |
do a full cross validation. More... | |
virtual bool | getStoreClassificationDetailsFlag () const =0 |
virtual void | loadParameters (STDATA &stData)=0 |
Read all parameters (e.g. More... | |
virtual void | loadParameters (StDataASCII &stData)=0 |
virtual void | loadParameters (StDataCmdLine &stData)=0 |
Same as loadParameters, but for Parameters from command line. More... | |
virtual void | preprocessTrainingData ()=0 |
trains all two-class SVM's with the whole data set. More... | |
virtual void | saveOnlyKernelParameters (StDataASCII &stData)=0 |
save only Kernel Parameters (this is used for user information and to detect in grid search, wether a kernel parameter is changed More... | |
virtual void | saveParameters (STDATA &stData)=0 |
store all parameters of the SVM to given mapstructured data More... | |
virtual void | saveParameters (StDataASCII &stData)=0 |
virtual void | saveStatistics (STDATA &statistics, int detailLevel=1)=0 |
save cross validation statistics. More... | |
virtual void | saveStatistics (StDataASCII &statistics, int detailLevel=1)=0 |
virtual void | setClassificationDelta (double d)=0 |
virtual void | setProgressReporter (ProgressReporter *pr)=0 |
set progress reporter object. More... | |
virtual void | setStoreClassificationDetailsFlag (bool f)=0 |
virtual void | setTrainingData (const PROBLEM *problem)=0 |
set the training data. More... | |
virtual const PROBLEM * | trainingData () const =0 |
get pointer to training data, that was set with setTrainingData(). More... | |
virtual void | updateKernelCache ()=0 |
call updateKernelCache() of selected svm with given problem. More... | |
Definition at line 76 of file BasicCVAdapter.hh.
typedef FV svt::BasicCVAdapter< FV, PROBLEM, STDATA >::FV_TYPE |
Definition at line 79 of file BasicCVAdapter.hh.
typedef PROBLEM svt::BasicCVAdapter< FV, PROBLEM, STDATA >::PROBLEM_TYPE |
Definition at line 80 of file BasicCVAdapter.hh.
|
inlinevirtual |
Definition at line 82 of file BasicCVAdapter.hh.
|
pure virtual |
set progress reporter object.
0 means no progress reporting. You are still the owner of this object, so you are responsible, that it exists during further calls to train(), etc. and that it is deleted afterwards
pr | pointer to ProgressReporter object or 0 if no progress reposting is desired |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
Read all parameters (e.g.
cost, gamma, etc) for the SVM from given structured data (e.g. an StDataASCII object). For non-existing keys the parameters remain unchanged, e.g. if key "cost" does not exist in the given map, the cost of the TwoClassSVMc will not be changed
stData | structured data containing parameters as key/value pairs |
... | depending on your STDATA class |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
|
pure virtual |
Same as loadParameters, but for Parameters from command line.
The StDataCmdLine keeps track of unused parameters
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
|
pure virtual |
store all parameters of the SVM to given mapstructured data
stData | structured data containing parameters as key/value pairs |
... | depending on your STDATA class |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
|
pure virtual |
save only Kernel Parameters (this is used for user information and to detect in grid search, wether a kernel parameter is changed
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
set the training data.
the CrossValidator only stores a pointer to it, so you are responsible that the training data keeps avaiblibe during further calls, and is deleted at the end of the program
problem | pointer to the training data |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
get pointer to training data, that was set with setTrainingData().
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
call updateKernelCache() of selected svm with given problem.
You are responsible to call this before preprocessTrainingData(), every time when kernel parameters or dataset was chenged. (usually every time before you call preprocessTrainingData())
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
call clearKernelCache() of selected svm.
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
trains all two-class SVM's with the whole data set.
This must be done before calling doFullCV() of doPartialCV(). If Kernel_MATRIX is used, you must call updateKernelCache() before
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
do a full cross validation.
Just calls doPartialCV() for each subset index and collects the results. See there for the preconditions
subsetIndexByUID | tells for each feature vector (identified by its uniqueID) to which subset it belongs. If the uniqueIDs of your feature vectors are consecutive numbers from 0...nFeatureVectors-1, then you can create this array with generateSortedSubsets() or generateShuffledSubsets() |
predictedClassLabelByUID | (output) stores the predicted class label for each feature vector. Will be resized to same size as subsetIndexByUID |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
save cross validation statistics.
statistics | structured data, where to store the statistics |
detailLevel | 0: nothing, 1: training statistics from last call to doFullCV() |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().
|
pure virtual |
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
|
pure virtual |
get classification details for each uid from last full CV or parital CV.
Use setStoreClassificationDetailsFlag() before preprocessTrainingData() to enable storage of these infos during cross validation
Implemented in svt::BasicCVAdapterTempl< FV, PROBLEM, STDATA, SVMTYPE >.
Referenced by svt::BasicCVAdapter< FV, PROBLEM, STDATA >::~BasicCVAdapter().