iRoCS Toolbox  1.1.0
Data Structures | Public Member Functions | Static Public Member Functions
svt::PlattProb< WrappedSVM > Class Template Reference

#include <PlattProb.hh>

Collaboration diagram for svt::PlattProb< WrappedSVM >:

Data Structures

struct  Traits
 

Public Member Functions

 PlattProb (WrappedSVM *svm=0)
 
 ~PlattProb ()
 
template<typename FV >
double classify (const FV &testObject, const typename Traits< FV >::ModelType &model) const
 standard classification without caching the kernel evaluations. More...
 
template<typename FV >
void train (const GroupedTrainingData< FV > &trainData, typename Traits< FV >::ModelType &model) const
 train SVM with given Feature Vectors. More...
 
template<typename ForwardIter >
void train (ForwardIter FV_begin, const ForwardIter &FV_end, typename Traits< typename std::iterator_traits< ForwardIter >::value_type >::ModelType &model) const
 train (STL-like interface) Your feature vector class must provide a method double getLabel(), which returns +1 or -1. More...
 
template<typename ForwardIter , typename Accessor >
void train (ForwardIter FV_begin, const ForwardIter &FV_end, typename Traits< typename Accessor::template Traits< ForwardIter >::value_type >::ModelType &model, Accessor accessor) const
 train (STL-like interface with additional Accessor) More...
 

Static Public Member Functions

static std::string description ()
 
static std::string name ()
 

Detailed Description

template<typename WrappedSVM>
class svt::PlattProb< WrappedSVM >

Definition at line 57 of file PlattProb.hh.

Constructor & Destructor Documentation

◆ PlattProb()

template<typename WrappedSVM>
svt::PlattProb< WrappedSVM >::PlattProb ( WrappedSVM *  svm = 0)
inline

Definition at line 69 of file PlattProb.hh.

Referenced by svt::PlattProb< WrappedSVM >::~PlattProb().

◆ ~PlattProb()

template<typename WrappedSVM>
svt::PlattProb< WrappedSVM >::~PlattProb ( )
inline

Definition at line 80 of file PlattProb.hh.

Member Function Documentation

◆ name()

template<typename WrappedSVM>
static std::string svt::PlattProb< WrappedSVM >::name ( )
inlinestatic

Definition at line 95 of file PlattProb.hh.

◆ description()

template<typename WrappedSVM>
static std::string svt::PlattProb< WrappedSVM >::description ( )
inlinestatic

Definition at line 100 of file PlattProb.hh.

◆ train() [1/3]

template<typename WrappedSVM>
template<typename FV >
void svt::PlattProb< WrappedSVM >::train ( const GroupedTrainingData< FV > &  trainData,
typename Traits< FV >::ModelType &  model 
) const

train SVM with given Feature Vectors.

this is the basic method, all others will call this one

Parameters
trainDatatraining data
model(output) model containing pointers to feature vectors, that became support vectors, alphas rho and parameters for sigmoid function

Referenced by svt::PlattProb< WrappedSVM >::description(), and svt::PlattProb< WrappedSVM >::train().

◆ train() [2/3]

template<typename WrappedSVM>
template<typename ForwardIter >
void svt::PlattProb< WrappedSVM >::train ( ForwardIter  FV_begin,
const ForwardIter &  FV_end,
typename Traits< typename std::iterator_traits< ForwardIter >::value_type >::ModelType &  model 
) const
inline

train (STL-like interface) Your feature vector class must provide a method double getLabel(), which returns +1 or -1.

The ModelType is svt::Model<FV>. Positive and negative labled feature vectors may be in any order in the given Container.

Parameters
FV_beginiterator pointing to first element of the container with the feature vectors
FV_enditerator pointing one past the last element of the container with the feature vectors
model(output) model containing pointers to feature vectors, that became support vectors, alphas and rho and parameters for sigmoid function

Definition at line 142 of file PlattProb.hh.

◆ train() [3/3]

template<typename WrappedSVM>
template<typename ForwardIter , typename Accessor >
void svt::PlattProb< WrappedSVM >::train ( ForwardIter  FV_begin,
const ForwardIter &  FV_end,
typename Traits< typename Accessor::template Traits< ForwardIter >::value_type >::ModelType &  model,
Accessor  accessor 
) const

train (STL-like interface with additional Accessor)

same as train(), but you can specify an Accessor for accessing the elements of your container. This accessor must return a reference to the corresponding feature vector. Use DirectAccessor for containers like std::vector<FV> and DereferencingAccessor for containers like std::vector<FV*>

Parameters
FV_beginiterator pointing to first element of the container with the feature vectors
FV_enditerator pointing one past the last element of the container with the feature vectors
model(output) model containing pointers to feature vectors, that became support vectors, alphas and rho and parameters for sigmoid function
accessorfunctor, which converts an iterator of your container into a pointer to a feature vector

◆ classify()

template<typename WrappedSVM>
template<typename FV >
double svt::PlattProb< WrappedSVM >::classify ( const FV &  testObject,
const typename Traits< FV >::ModelType &  model 
) const

standard classification without caching the kernel evaluations.

Parameters
testObjectfeature vector of the test object
modelmodel containing Support Vectors, alphas and rho and parameters for sigmoid function
Returns
probability estimate

Referenced by svt::PlattProb< WrappedSVM >::train().


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