iRoCS Toolbox  1.1.0
Public Member Functions
svt::GroupedTrainingData< FV > Class Template Reference

The GroupedTrainingData class is a container for feature vectors. More...

#include <GroupedTrainingData.hh>

Collaboration diagram for svt::GroupedTrainingData< FV >:

Public Member Functions

 GroupedTrainingData ()
 
 GroupedTrainingData (const SVM_Problem< FV > &problem)
 
template<typename ForwardIter , typename Accessor >
 GroupedTrainingData (ForwardIter FV_begin, const ForwardIter &FV_end, Accessor accessor)
 
std::vector< FV * > & allFeatureVectors ()
 
const std::vector< FV * > & allFeatureVectors () const
 
double classIndexToLabel (int classIndex) const
 
const std::vector< double > & classIndizesToLabels () const
 
unsigned int classStartIndex (int classIndex) const
 
void create (const SVM_Problem< FV > &problem)
 
template<typename ForwardIter , typename Accessor >
void create (ForwardIter FV_begin, const ForwardIter &FV_end, Accessor accessor)
 
FV * featureVector (unsigned int i) const
 
std::vector< FV * >::const_iterator FV_begin () const
 
std::vector< FV * >::const_iterator FV_end () const
 
double label (unsigned int fvIndex) const
 
unsigned int nClasses () const
 
size_t nFeatureVectors () const
 

Detailed Description

template<typename FV>
class svt::GroupedTrainingData< FV >

The GroupedTrainingData class is a container for feature vectors.

They are grouped internally by their label

The grouping is done by a std::stable_sort, which ensures maximal performance for allready correct grouped data. The order within one groups is preserved.

This class is used in multi-class SVM Algorithms and improves performance if a multi-class classifier is called multiple times (e.g. during a cross validation)

Parameters
FVa feature vector class (e.g. BasicFV, SparseFV, or your own class)

Definition at line 96 of file GroupedTrainingData.hh.

Constructor & Destructor Documentation

◆ GroupedTrainingData() [1/3]

template<typename FV>
svt::GroupedTrainingData< FV >::GroupedTrainingData ( )
inline

Definition at line 100 of file GroupedTrainingData.hh.

◆ GroupedTrainingData() [2/3]

template<typename FV>
svt::GroupedTrainingData< FV >::GroupedTrainingData ( const SVM_Problem< FV > &  problem)
inline

Definition at line 105 of file GroupedTrainingData.hh.

◆ GroupedTrainingData() [3/3]

template<typename FV>
template<typename ForwardIter , typename Accessor >
svt::GroupedTrainingData< FV >::GroupedTrainingData ( ForwardIter  FV_begin,
const ForwardIter &  FV_end,
Accessor  accessor 
)
inline

Definition at line 112 of file GroupedTrainingData.hh.

Member Function Documentation

◆ create() [1/2]

template<typename FV>
void svt::GroupedTrainingData< FV >::create ( const SVM_Problem< FV > &  problem)

◆ create() [2/2]

template<typename FV>
template<typename ForwardIter , typename Accessor >
void svt::GroupedTrainingData< FV >::create ( ForwardIter  FV_begin,
const ForwardIter &  FV_end,
Accessor  accessor 
)

◆ nClasses()

template<typename FV>
unsigned int svt::GroupedTrainingData< FV >::nClasses ( ) const
inline

Definition at line 125 of file GroupedTrainingData.hh.

◆ classIndexToLabel()

template<typename FV>
double svt::GroupedTrainingData< FV >::classIndexToLabel ( int  classIndex) const
inline

Definition at line 130 of file GroupedTrainingData.hh.

◆ classIndizesToLabels()

template<typename FV>
const std::vector<double>& svt::GroupedTrainingData< FV >::classIndizesToLabels ( ) const
inline

Definition at line 135 of file GroupedTrainingData.hh.

◆ classStartIndex()

template<typename FV>
unsigned int svt::GroupedTrainingData< FV >::classStartIndex ( int  classIndex) const
inline

Definition at line 140 of file GroupedTrainingData.hh.

◆ nFeatureVectors()

template<typename FV>
size_t svt::GroupedTrainingData< FV >::nFeatureVectors ( ) const
inline

Definition at line 145 of file GroupedTrainingData.hh.

◆ featureVector()

template<typename FV>
FV* svt::GroupedTrainingData< FV >::featureVector ( unsigned int  i) const
inline

Definition at line 152 of file GroupedTrainingData.hh.

◆ label()

template<typename FV>
double svt::GroupedTrainingData< FV >::label ( unsigned int  fvIndex) const
inline

Definition at line 158 of file GroupedTrainingData.hh.

◆ allFeatureVectors() [1/2]

template<typename FV>
std::vector<FV*>& svt::GroupedTrainingData< FV >::allFeatureVectors ( )
inline

Definition at line 173 of file GroupedTrainingData.hh.

◆ allFeatureVectors() [2/2]

template<typename FV>
const std::vector<FV*>& svt::GroupedTrainingData< FV >::allFeatureVectors ( ) const
inline

Definition at line 178 of file GroupedTrainingData.hh.

◆ FV_begin()

template<typename FV>
std::vector<FV*>::const_iterator svt::GroupedTrainingData< FV >::FV_begin ( ) const
inline

◆ FV_end()

template<typename FV>
std::vector<FV*>::const_iterator svt::GroupedTrainingData< FV >::FV_end ( ) const
inline

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