LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::svm::parameters Class Reference

the parameters for the class svm More...

#include <ltiSVM.h>

Inheritance diagram for lti::svm::parameters:
Inheritance graph
[legend]
Collaboration diagram for lti::svm::parameters:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 parameters ()
 parameters (const parameters &other)
virtual ~parameters ()
const char * getTypeName () const
parameterscopy (const parameters &other)
parametersoperator= (const parameters &other)
virtual classifier::parametersclone () const
void setKernel (const kernelFunctor< double > &k)
void attachKernel (kernelFunctor< double > *k)
void useExternalKernel (kernelFunctor< double > *k)
kernelFunctor< double > * createKernel (const std::string &name) const
virtual bool write (ioHandler &handler, const bool complete=true) const
virtual bool read (ioHandler &handler, const bool complete=true)

Public Attributes

int nSupport
double C
kernelFunctor< double > * kernel
double bias
double tolerance
double epsilon
bool sumToOne
bool normalizeData
bool usePairwise

Detailed Description

the parameters for the class svm


Constructor & Destructor Documentation

lti::svm::parameters::parameters (  ) 

default constructor

Reimplemented from lti::classifier::parameters.

lti::svm::parameters::parameters ( const parameters other  ) 

copy constructor

Parameters:
other the parameters object to be copied
virtual lti::svm::parameters::~parameters (  )  [virtual]

destructor

Reimplemented from lti::classifier::parameters.


Member Function Documentation

void lti::svm::parameters::attachKernel ( kernelFunctor< double > *  k  ) 

Sets a new kernel function.

The kernel which is passed here as an argument must have been allocated with new; it must not be a local variable. On destruction of the parameters object, the kernel will be deleted, i.e. this parameters instance will be responsible for the memory managment of the object.

virtual classifier::parameters* lti::svm::parameters::clone (  )  const [virtual]

returns a pointer to a clone of the parameters

Reimplemented from lti::classifier::parameters.

parameters& lti::svm::parameters::copy ( const parameters other  ) 

copy the contents of a parameters object

Parameters:
other the parameters object to be copied
Returns:
a reference to this parameters object
kernelFunctor<double>* lti::svm::parameters::createKernel ( const std::string &  name  )  const

create a new kernel function, using its class name.

A pointer to the kernel function is returned, so that the caller may modify the kernel's parameters.

const char* lti::svm::parameters::getTypeName (  )  const [virtual]

returns name of this type.

Reimplemented from lti::classifier::parameters.

parameters& lti::svm::parameters::operator= ( const parameters other  ) 

copy the contents of a parameters object

Parameters:
other the parameters object to be copied
Returns:
a reference to this parameters object
virtual bool lti::svm::parameters::read ( ioHandler handler,
const bool  complete = true 
) [virtual]

read the parameters from the given ioHandler

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful

Reimplemented from lti::classifier::parameters.

void lti::svm::parameters::setKernel ( const kernelFunctor< double > &  k  ) 

Sets a new kernel function.

A copy of the kernel will be done (so it is useless to change the parameters of the given kernel instance, because the internal kernel will never notice the changes done to its "parent").

void lti::svm::parameters::useExternalKernel ( kernelFunctor< double > *  k  ) 

Sets a new kernel function.

The kernel which is passed here as an argument is not deleted by the parameters object, the caller must ensure that there are no memory leaks.

virtual bool lti::svm::parameters::write ( ioHandler handler,
const bool  complete = true 
) const [virtual]

write the parameters in the given ioHandler

Parameters:
handler the ioHandler to be used
complete if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written.
Returns:
true if write was successful

Reimplemented from lti::classifier::parameters.


Member Data Documentation

The initial threshold of the SVM.

Default value: 1

The "C" parameter.

The meaning is explained in the standard SVM literature; the boiled down version is that C controls the generalization ability of the SVM. The larger C, the more accurate the recognition on the training set. On the other hand, the generalization performance is better with a smaller C.

Default value: 1

Epsilon for detecting change in alpha value.

Default value: 1e-12

The kernel function.

Try to use the kernel setting methods in order to ensure a consistent memory managment of the pointed instance.

See also:
setKernel(),attachKernel(),useExternalKernel()

Default value: "linearKernel"

If this flag is true, the training data are normalized to mean zero and variance one before training the svm.

This means that a copy of the training data is required. The transformation is stored and also used for testing. However, it is essential for SVM training that the data have low magnitudes. If the data have a variance of 100, the training simply may fail. The default value is false.

The number of support vectors that must be used.

Default value: 0

Is true if the result should be normalized to sum 1.

Default value: false

The tolerance for detecting a violation of the KKT conditions.

Default value: 1e-3

The normal SVM algorithm uses a one-against-all scheme for multi-class classification.

However, as is pointed out in ..., this is suboptimal in some cases. Therefore, you can use a combination of one-against-one classifiers (n*(n-1)/2 for n classes). Default: false.


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:27:01 2010 for LTI-Lib by Doxygen 1.6.1