yat
0.14.5pre
|
Class for Fisher's t-test. More...
#include <yat/statistics/tScore.h>
Public Member Functions | |
tScore (bool absolute=true) | |
Default Constructor. | |
double | score (const classifier::Target &target, const utility::VectorBase &value) const |
double | score (const classifier::Target &target, const utility::VectorBase &value, double *dof) const |
double | score (const classifier::Target &target, const classifier::DataLookupWeighted1D &value, double *dof=0) 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 |
double | score (const classifier::Target &target, const utility::VectorBase &value, const utility::VectorBase &weight, double *dof=0) const |
template<typename T1 , typename T2 > | |
double | score (const T1 &pos, const T2 &neg, double *dof=0) 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_ |
Class for Fisher's t-test.
See http://en.wikipedia.org/wiki/Student's_t-test for more details on the t-test.
|
virtual |
Calculates the value of t-score, i.e. the ratio between difference in mean and standard deviation of this difference. where is the mean, is the number of data points and
Implements theplu::yat::statistics::Score.
|
virtualinherited |
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::tScore::score | ( | const classifier::Target & | target, |
const utility::VectorBase & | value, | ||
double * | dof | ||
) | const |
Calculates the value of t-score, i.e. the ratio between difference in mean and standard deviation of this difference. where is the mean, is the number of data points and
target | Target defining the two groups |
value | Vector with data points on which calculation is based |
dof | double pointer in which approximation of degrees of freedom is returned: pos.n()+neg.n()-2. See AveragerWeighted. |
double theplu::yat::statistics::tScore::score | ( | const classifier::Target & | target, |
const classifier::DataLookupWeighted1D & | value, | ||
double * | dof = 0 |
||
) | const |
Calculates the weighted t-score, i.e. the ratio between difference in mean and standard deviation of this difference. where is the weighted mean, n is the weighted version of number of data points , and is an estimation of the variance . See AveragerWeighted for details.
target | Target defining the two groups |
value | Vector with values/weights on which calculation is based |
dof | double pointer in which approximation of degrees of freedom is returned: pos.n()+neg.n()-2. See AveragerWeighted. |
|
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.
|
virtual |
Calculates the weighted t-score, i.e. the ratio between difference in mean and standard deviation of this difference. where is the weighted mean, n is the weighted version of number of data points , and is an estimation of the variance . See AveragerWeighted for details.
Reimplemented from theplu::yat::statistics::Score.
|
virtual |
Calculates the weighted t-score, i.e. the ratio between difference in mean and standard deviation of this difference. where is the weighted mean, n is the weighted version of number of data points and is an estimation of the variance . See AveragerWeighted for details.
Implements theplu::yat::statistics::Score.
double theplu::yat::statistics::tScore::score | ( | const classifier::Target & | target, |
const utility::VectorBase & | value, | ||
const utility::VectorBase & | weight, | ||
double * | dof = 0 |
||
) | const |
Calculates the weighted t-score, i.e. the ratio between difference in mean and standard deviation of this difference. where is the weighted mean, n is the weighted version of number of data points and is an estimation of the variance . See AveragerWeighted for details.
target | Target defining the two groups |
value | Vector with data values on which calculation is based |
weight | Vector with weight associated to value |
dof | double pointer in which approximation of degrees of freedom is returned: pos.n()+neg.n()-2. See AveragerWeighted. |
double theplu::yat::statistics::tScore::score | ( | const T1 & | pos, |
const T2 & | neg, | ||
double * | dof = 0 |
||
) | const |
Calcultate t-score from Averager like objects. Requirements for T1 and T2 are: double mean(), double n(), double sum_xx_centered()
If dof is not a null pointer it is assigned to number of degrees of freedom.
|
protectedinherited |
true if method is absolute, which means if score is below expected value (by chance) E, score returns E-score+E instead.