latest version v1.9 - last update 10 Apr 2010 |
This class does a cross validation on the given dataset and returns the average recognition rates. More...
#include <ltiCrossValidator.h>
Classes | |
class | parameters |
the parameters for the class crossValidator More... | |
Public Member Functions | |
crossValidator () | |
crossValidator (const crossValidator &other) | |
virtual | ~crossValidator () |
virtual const char * | getTypeName () const |
double | apply (const dmatrix &data, const ivector &ids) const |
bool | apply (const dmatrix &data, const ivector &ids, double &avRecogRate) const |
crossValidator & | copy (const crossValidator &other) |
crossValidator & | operator= (const crossValidator &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Protected Member Functions | |
bool | splitData (const dmatrix &data, std::list< ivector > &splittedData) const |
This class does a cross validation on the given dataset and returns the average recognition rates.
It divides the data at random in nbOfSplits distinct segments. Then the network is trained with nbOfSplits-1 of the segments. Then each data point of the remaining segment is classified. This process is repeated for every possible choice of the the segment which is omited from the classification process. The classifier that is used for validation is expected to delete old results from previous trainings, because the classifier is trained with different training data set during validation.
lti::crossValidator::crossValidator | ( | ) |
default constructor
lti::crossValidator::crossValidator | ( | const crossValidator & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::crossValidator::~crossValidator | ( | ) | [virtual] |
destructor
bool lti::crossValidator::apply | ( | const dmatrix & | data, | |
const ivector & | ids, | |||
double & | avRecogRate | |||
) | const |
Computes the average the average recognition rate of the given data using the specified classifier.
data | dmatrix with the source data. | |
ids | ivector with the ids of each data point in data. | |
avRecogRate | the average recognition rate |
Computes the average the average recognition rate of the given data using the specified classifier.
data | dmatrix with the source data. | |
ids | ivector with the ids of each data point in data. |
virtual functor* lti::crossValidator::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
crossValidator& lti::crossValidator::copy | ( | const crossValidator & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
const parameters& lti::crossValidator::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
virtual const char* lti::crossValidator::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("crossValidator")
Reimplemented from lti::functor.
crossValidator& lti::crossValidator::operator= | ( | const crossValidator & | other | ) |
bool lti::crossValidator::splitData | ( | const dmatrix & | data, | |
std::list< ivector > & | splittedData | |||
) | const [protected] |
Splits the given data into parts.
The points are randomly drawn from the the src data.