yat
0.20.3pre
|
Perform quantile normalization. More...
#include <yat/normalizer/QuantileNormalizer2.h>
Public Member Functions | |
QuantileNormalizer2 (void) | |
QuantileNormalizer2 (const QuantileNormalizer2 &other) | |
QuantileNormalizer2 (QuantileNormalizer2 &&other) | |
QuantileNormalizer2 & | operator= (const QuantileNormalizer2 &rhs) |
QuantileNormalizer2 & | operator= (QuantileNormalizer2 &&rhs) |
void | train (const utility::MatrixBase &data) |
void | operator() (const utility::MatrixBase &input, utility::MatrixMutable &result) |
perform the quantile normalization. More... | |
void | normalize (const utility::MatrixBase &input, utility::MatrixMutable &result) const |
void | normalize (const utility::VectorBase &input, utility::VectorMutable &result) const |
Friends | |
void | swap (QuantileNormalizer2 &lhs, QuantileNormalizer2 &rhs) |
Related Functions | |
(Note that these are not member functions.) | |
void | swap (QuantileNormalizer2 &lhs, QuantileNormalizer2 &rhs) |
Perform quantile normalization.
After a quantile normalization each column has the same distribution of data (the quantiles are the same). Also, within each column the rank of an element is not changed. The distribution that each column follows is determined by taking the average across columns, i.e., the largest element in each column will be equal to the average of the largest elements. The 2nd largest element in each column will be equal to the average of the 2nd largest element in each column et cetera.
theplu::yat::normalizer::QuantileNormalizer2::QuantileNormalizer2 | ( | void | ) |
Defaul constructor
theplu::yat::normalizer::QuantileNormalizer2::QuantileNormalizer2 | ( | const QuantileNormalizer2 & | other | ) |
Copy constructor
theplu::yat::normalizer::QuantileNormalizer2::QuantileNormalizer2 | ( | QuantileNormalizer2 && | other | ) |
Move constructor
void theplu::yat::normalizer::QuantileNormalizer2::normalize | ( | const utility::MatrixBase & | input, |
utility::MatrixMutable & | result | ||
) | const |
Equivalent with calling normalize(const utility::VectorBase&,utility::MatrixMutable&) const; for each column in input and result.
Requires that a typical distribution has been inferred via train() or operator().
It is possible to normalize "in place"; it is permissible for input and result to reference to the same Matrix. If the input and result are overlapping in any other way the behaviour is undefined.
void theplu::yat::normalizer::QuantileNormalizer2::normalize | ( | const utility::VectorBase & | input, |
utility::VectorMutable & | result | ||
) | const |
The result vector will be filled with the values from the typical distribution (inferred from train() or operator()) in such a way that if the nth element is the smallest value in the input, the nth element is also the smallest element in result and so on.
If the size of the template (passed via train function) and the input are not the same, values interpolated. Both for the template and result data, x is equally distributed between 0 and 1 such that kth value is (k+0.5) / N, where N is size of the data range. The normalised is interpolated from the two nearest data points in the template using linear interpolation.
Requires that a typical distribution has been inferred via train() or operator().
It is possible to normalize "in place"; it is permissible for input and result to reference to the same Matrix. If the input and result are overlapping in any other way the behaviour is undefined.
void theplu::yat::normalizer::QuantileNormalizer2::operator() | ( | const utility::MatrixBase & | input, |
utility::MatrixMutable & | result | ||
) |
perform the quantile normalization.
Equivalent to calling
It is possible to normalize "in place"; it is permissible for matrix and result to reference to the same Matrix. If the input and result are overlapping in any other way the behaviour is undefined.
QuantileNormalizer2& theplu::yat::normalizer::QuantileNormalizer2::operator= | ( | const QuantileNormalizer2 & | rhs | ) |
Copy assignment
QuantileNormalizer2& theplu::yat::normalizer::QuantileNormalizer2::operator= | ( | QuantileNormalizer2 && | rhs | ) |
Move assignment
void theplu::yat::normalizer::QuantileNormalizer2::train | ( | const utility::MatrixBase & | data | ) |
Calculate the typical distribution from data. The first element is calculated by taking the average of the smallest value of each column, the 2nd element is calculated by taking the average of the 2nd smallest element of each column, et c. The resulting distribution has the same size as the number of rows in data.
|
related |
Swap two quantile normalizers.