iRoCS Toolbox
1.1.0
|
The SVMBase class is the the base class for all SVM's. More...
#include <SVMBase.hh>
Data Structures | |
struct | Traits |
Public Types | |
typedef KF | KF_type |
Public Member Functions | |
SVMBase () | |
Default Constructor. More... | |
SVMBase (const KF &kernel) | |
Constructor with Kernel function. More... | |
~SVMBase () | |
Destructor. More... | |
float | cacheSizeMB () const |
template<typename FV > | |
double | classify (const FV &testObject, const Model< FV > &model) const |
standard classification without caching the kernel evaluations. More... | |
void | clearKernelCache () const |
call the clearCache() method of selected Kernel More... | |
KF & | kernel () |
access the kernel function More... | |
const KF & | kernel () const |
template<typename STDATA > | |
void | loadParameters (STDATA &stData) |
Load parameters from structured data object. More... | |
template<typename STDATA > | |
void | saveParameters (STDATA &stData) const |
save parameters to structured data object More... | |
void | setCacheSizeMB (float s) |
set cache memory size in MB (default: 40) More... | |
void | setProgressReporter (ProgressReporter *pr) |
set a progress reporter object. More... | |
void | setShrinkingFlag (bool f) |
whether to use the shrinking heuristics (default: true) More... | |
void | setTerminationEpsilon (double e) |
set tolerance of termination criterion (default: 0.001) More... | |
bool | shrinkingFlag () const |
double | terminationEpsilon () const |
template<typename ForwardIter , typename Accessor > | |
void | updateKernelCache (const ForwardIter &fvBegin, const ForwardIter &fvEnd, Accessor accessor) const |
call the updateCache() method of selected Kernel More... | |
Static Public Member Functions | |
static void | getParamInfos (std::vector< ParamInfo > &p) |
get information about the parameters, that are used in loadParameters() and saveParameters(). More... | |
Protected Attributes | |
float | _cacheSizeMB |
ProgressReporter * | _pr |
bool | _shrinkingFlag |
double | _terminationEpsilon |
KF | p_kernel |
The SVMBase class is the the base class for all SVM's.
it contains the parameters, that are needed for all training procedures (similar to svm_param in original libsvm)
Definition at line 101 of file SVMBase.hh.
typedef KF svt::SVMBase< KF >::KF_type |
Definition at line 108 of file SVMBase.hh.
|
inline |
Default Constructor.
Definition at line 119 of file SVMBase.hh.
|
inline |
Constructor with Kernel function.
The given kernel will be copied to a private variable. You may access it later with kernel()
kernel | the kernel function object |
Definition at line 137 of file SVMBase.hh.
|
inline |
Destructor.
Definition at line 151 of file SVMBase.hh.
|
inline |
access the kernel function
Definition at line 164 of file SVMBase.hh.
|
inline |
Definition at line 170 of file SVMBase.hh.
|
inline |
call the updateCache() method of selected Kernel
Definition at line 187 of file SVMBase.hh.
|
inline |
call the clearCache() method of selected Kernel
Definition at line 206 of file SVMBase.hh.
double svt::SVMBase< KF >::classify | ( | const FV & | testObject, |
const Model< FV > & | model | ||
) | const |
standard classification without caching the kernel evaluations.
testObject | feature vector of the test object |
model | model containing Support Vectors, alphas and rho. |
Referenced by svt::SVMBase< KF >::clearKernelCache().
|
inline |
set tolerance of termination criterion (default: 0.001)
e | new value for epsilon |
Definition at line 236 of file SVMBase.hh.
|
inline |
Definition at line 241 of file SVMBase.hh.
Referenced by svt::SVMBase< KF >::saveParameters().
|
inline |
set cache memory size in MB (default: 40)
s | cache size in MBytes |
Definition at line 255 of file SVMBase.hh.
|
inline |
Definition at line 260 of file SVMBase.hh.
Referenced by svt::SVMBase< KF >::saveParameters().
|
inline |
whether to use the shrinking heuristics (default: true)
f | true = use shrinking heuristics |
Definition at line 274 of file SVMBase.hh.
|
inline |
Definition at line 279 of file SVMBase.hh.
Referenced by svt::SVMBase< KF >::saveParameters().
|
inline |
Load parameters from structured data object.
Definition at line 290 of file SVMBase.hh.
Referenced by svt::TwoClassSVMnu< KF >::loadParameters(), and svt::TwoClassSVMc< KF >::loadParameters().
|
inline |
save parameters to structured data object
Definition at line 306 of file SVMBase.hh.
Referenced by svt::TwoClassSVMnu< KF >::saveParameters(), and svt::TwoClassSVMc< KF >::saveParameters().
|
inlinestatic |
get information about the parameters, that are used in loadParameters() and saveParameters().
The Infos are appended to the passed array
p | array of ParamInfos. The Infos will be appended to this array |
Definition at line 326 of file SVMBase.hh.
Referenced by svt::TwoClassSVMnu< KF >::getParamInfos(), and svt::TwoClassSVMc< KF >::getParamInfos().
|
inline |
set a progress reporter object.
Every time any progress is made in the training or classification, the reportProgress() method of this object is callled.
pr | pointer to an object with a child class of ProgressReporter or 0, if you don't want any more progress reporting. You are responsible, that your ProgressReporter object is not deleted during operation of MultiClassSVMOneVsOne |
Definition at line 358 of file SVMBase.hh.
|
protected |
Definition at line 366 of file SVMBase.hh.
Referenced by svt::SVMBase< KF >::clearKernelCache(), svt::SVMBase< KF >::kernel(), svt::SVMBase< KF >::loadParameters(), svt::SVMBase< KF >::saveParameters(), and svt::SVMBase< KF >::updateKernelCache().
|
protected |
Definition at line 367 of file SVMBase.hh.
Referenced by svt::SVMBase< KF >::loadParameters(), svt::SVMBase< KF >::setTerminationEpsilon(), and svt::SVMBase< KF >::terminationEpsilon().
|
protected |
Definition at line 368 of file SVMBase.hh.
Referenced by svt::SVMBase< KF >::cacheSizeMB(), svt::SVMBase< KF >::loadParameters(), and svt::SVMBase< KF >::setCacheSizeMB().
|
protected |
Definition at line 369 of file SVMBase.hh.
Referenced by svt::SVMBase< KF >::loadParameters(), svt::SVMBase< KF >::setShrinkingFlag(), and svt::SVMBase< KF >::shrinkingFlag().
|
protected |
Definition at line 370 of file SVMBase.hh.
Referenced by svt::SVMBase< KF >::setProgressReporter(), and svt::SVMBase< KF >::updateKernelCache().