source: trunk/yat/normalization/QuantileNormalizer.h @ 1447

Last change on this file since 1447 was 1447, checked in by Peter, 13 years ago

Changed the interface of QuantileNormalizer?. The interface now has one matrix& and one const&. The former is object for normalization, and the latter is the base for calculating the distributions (Quantiles). The reason to change the interface is to allow normalization based on a nother matrix, e.g., normalizing a test data matrix based on the training data matrix. Also it is more inline with the Centralizer added earlier today. refs #425

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#ifndef _theplu_yat_normalization_quantile_normalizer_
2#define _theplu_yat_normalization_quantile_normalizer_
3
4/*
5  Copyright (C) 2008 Peter Johansson
6
7  This file is part of the yat library, http://dev.thep.lu.se/yat
8
9  The yat library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version.
13
14  The yat library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22  02111-1307, USA.
23*/
24
25namespace theplu {
26namespace yat {
27namespace utility {
28  class Matrix;
29}
30namespace normalization {
31
32  /**
33     \brief Perform quantile normalization
34
35     \since New in yat 0.5
36   */
37  class QuantileNormalizer
38  {
39  public:
40    /**
41       The \a matrix is normalized by sorting each column, replacing
42       each value with the average across rows, and undo the sorting
43       in step 1. This results in a \a matrix in which each column has
44       the same distribution of data, and the rank of an element
45       within a column is preserved in the normalization.
46     */
47    void operator()(const utility::Matrix& matrix, 
48                    utility::Matrix& result) const;
49  };
50
51}}} // end of namespace normalization, yat and thep
52#endif
Note: See TracBrowser for help on using the repository browser.