Ignore:
Timestamp:
Sep 21, 2008, 7:54:19 PM (14 years ago)
Author:
Peter
Message:

Adding a Zscore normalizer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization_test.cc

    r1520 r1521  
    2828#include "yat/normalizer/RowNormalizer.h"
    2929#include "yat/normalizer/Spearman.h"
     30#include "yat/normalizer/Zscore.h"
    3031
    3132#include "yat/utility/DataIterator.h"
     
    4445void test_spearman(test::Suite&);
    4546void test_spearman_weighted(test::Suite&);
     47void test_z_score(test::Suite&);
    4648
    4749int main(int argc, char* argv[])
     
    5557  test_row_normalize(suite);
    5658  test_spearman(suite);
     59  test_z_score(suite);
    5760
    5861  return suite.return_value();
     
    220223  suite.add(suite.equal(res(0,3).data(), 0.5/3));
    221224}
     225
     226void test_z_score(test::Suite& suite)
     227{
     228  suite.err() << "Testing Zscore\n";
     229  std::vector<double> vec;
     230  vec.push_back(0);
     231  vec.push_back(3.14);
     232  normalizer::Zscore zscore;
     233  zscore(vec.begin(), vec.end(), vec.begin());
     234  for (size_t i=0; i<vec.size(); ++i)
     235    suite.add(suite.equal(vec[i], 2.0*i-1.0));
     236}
     237
     238
Note: See TracChangeset for help on using the changeset viewer.