#include <yat/statistics/Pearson.h>
Public Member Functions | |
Pearson (bool absolute=true) | |
The default constructor. | |
virtual | ~Pearson (void) |
The destructor. | |
double | score (const classifier::Target &target, const utility::VectorBase &value) const |
double | score (const classifier::Target &target, const classifier::DataLookupWeighted1D &value) const |
double | score (const classifier::Target &target, const utility::VectorBase &value, const utility::VectorBase &weight) const |
void | absolute (bool absolute) |
Function changing mode of Score. | |
virtual double | score (const classifier::Target &target, const classifier::DataLookup1D &value) const |
double | score (const classifier::Target &target, const classifier::DataLookup1D &value, const classifier::DataLookup1D &weight) const |
Protected Attributes | |
bool | absolute_ |
double theplu::yat::statistics::Pearson::score | ( | const classifier::Target & | target, | |
const utility::VectorBase & | value | |||
) | const [virtual] |
.
Implements theplu::yat::statistics::Score.
double theplu::yat::statistics::Pearson::score | ( | const classifier::Target & | target, | |
const classifier::DataLookupWeighted1D & | value | |||
) | const [virtual] |
, where and . This expression is chosen to get a correlation equal to unity when x and y are equal.
Reimplemented from theplu::yat::statistics::Score.
double theplu::yat::statistics::Pearson::score | ( | const classifier::Target & | target, | |
const utility::VectorBase & | value, | |||
const utility::VectorBase & | weight | |||
) | const [virtual] |
, where and . This expression is chosen to get a correlation equal to unity when x and y are equal.
Implements theplu::yat::statistics::Score.
virtual double theplu::yat::statistics::Score::score | ( | const classifier::Target & | target, | |
const classifier::DataLookup1D & | value | |||
) | const [virtual, inherited] |
Function calculating the score. In absolute mode, also the score using negated class labels is calculated, and the largest of the two scores are calculated.
value is copied to a utility::vector and that operator is called. If speed is important this operator should be implemented in inherited class to avoid copying.
double theplu::yat::statistics::Score::score | ( | const classifier::Target & | target, | |
const classifier::DataLookup1D & | value, | |||
const classifier::DataLookup1D & | weight | |||
) | const [inherited] |
Function calculating the weighted version of score. In absolute mode, also the score using negated class labels is calculated, and the largest of the two scores are calculated. Absolute mode should be used when two-tailed test is wanted.
value and weight are copied to utility::vector and the corresponding operator is called. If speed is important this operator should be implemented in inherited class to avoid copying.
bool theplu::yat::statistics::Score::absolute_ [protected, inherited] |
true if method is absolute, which means if score is below expected value (by chance) E, score returns E-score+E instead.