yat  0.21pre
Public Member Functions | Friends | Related Functions | List of all members
theplu::yat::normalizer::QuantileNormalizer2 Class Reference

Perform quantile normalization. More...

#include <yat/normalizer/QuantileNormalizer2.h>

Public Member Functions

 QuantileNormalizer2 (void)
 
 QuantileNormalizer2 (const QuantileNormalizer2 &other)
 
 QuantileNormalizer2 (QuantileNormalizer2 &&other)
 
QuantileNormalizer2operator= (const QuantileNormalizer2 &rhs)
 
QuantileNormalizer2operator= (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)
 

Detailed Description

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.

Since
New in yat 0.20

Constructor & Destructor Documentation

◆ QuantileNormalizer2() [1/3]

theplu::yat::normalizer::QuantileNormalizer2::QuantileNormalizer2 ( void  )

Defaul constructor

◆ QuantileNormalizer2() [2/3]

theplu::yat::normalizer::QuantileNormalizer2::QuantileNormalizer2 ( const QuantileNormalizer2 other)

Copy constructor

◆ QuantileNormalizer2() [3/3]

theplu::yat::normalizer::QuantileNormalizer2::QuantileNormalizer2 ( QuantileNormalizer2 &&  other)

Move constructor

Member Function Documentation

◆ normalize() [1/2]

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.

Note
dimensions of input and result must match.

◆ normalize() [2/2]

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.

Note
dimensions of input and result must match.

◆ operator()()

void theplu::yat::normalizer::QuantileNormalizer2::operator() ( const utility::MatrixBase input,
utility::MatrixMutable result 
)

perform the quantile normalization.

Equivalent to calling

train(input);
normalize(input, result);

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.

Note
dimensions of matrix and result must match.

◆ operator=() [1/2]

QuantileNormalizer2& theplu::yat::normalizer::QuantileNormalizer2::operator= ( const QuantileNormalizer2 rhs)

Copy assignment

◆ operator=() [2/2]

QuantileNormalizer2& theplu::yat::normalizer::QuantileNormalizer2::operator= ( QuantileNormalizer2 &&  rhs)

Move assignment

◆ train()

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.

Friends And Related Function Documentation

◆ swap()

void swap ( QuantileNormalizer2 lhs,
QuantileNormalizer2 rhs 
)
related

Swap two quantile normalizers.


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

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14