Ignore:
Timestamp:
Aug 28, 2008, 4:56:42 AM (15 years ago)
Author:
Peter
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/normalization/QuantileNormalizer.cc

    r1432 r1447  
    3535namespace normalization {
    3636
    37   void QuantileNormalizer::operator()(utility::Matrix& data) const
     37  void QuantileNormalizer::operator()(const utility::Matrix& data,
     38                                      utility::Matrix& result) const
    3839  {
    3940    utility::Matrix data_copy(data);
     
    5051    }
    5152
    52     for (size_t column=0; column<data.columns(); ++column){
     53    for (size_t column=0; column<result.columns(); ++column){
    5354      std::vector<size_t> index;
    54       utility::sort_index(index, data.column_const_view(column));
     55      utility::sort_index(index, result.column_const_view(column));
    5556                               
    56       for (size_t row=0; row<data.rows(); ++row)
    57         data(index[row], column) = averager[row].mean();
     57      for (size_t row=0; row<result.rows(); ++row)
     58        result(index[row], column) = averager[row].mean();
    5859    }
    5960  }
Note: See TracChangeset for help on using the changeset viewer.