Ignore:
Timestamp:
Sep 12, 2008, 5:44:31 PM (13 years ago)
Author:
Peter
Message:

unweighted version of the Spearman Normalization. refs #437.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization_test.cc

    r1487 r1496  
    2525#include "yat/normalization/ColumnNormalizer.h"
    2626#include "yat/normalization/QuantileNormalizer.h"
     27#include "yat/normalization/Spearman.h"
    2728
    2829#include "yat/utility/Matrix.h"
     
    3435void test_column_normalize(test::Suite&);
    3536void test_quantile_normalize(test::Suite&);
     37void test_spearman(test::Suite&);
    3638
    3739int main(int argc, char* argv[])
     
    4345  test_column_normalize(suite);
    4446  test_quantile_normalize(suite);
     47  test_spearman(suite);
    4548
    4649  return suite.return_value();
     
    105108}
    106109
     110void test_spearman(test::Suite& suite)
     111{
     112  suite.err() << "Testing Spearman\n";
     113  normalization::Spearman spearman;
     114  std::vector<double> vec;
     115  vec.push_back(0);
     116  vec.push_back(2);
     117  vec.push_back(3);
     118  vec.push_back(1);
     119  spearman(vec.begin(), vec.end(), vec.begin());
     120  std::vector<double> correct;
     121  correct.push_back(0);
     122  correct.push_back(0.5);
     123  correct.push_back(0.75);
     124  correct.push_back(0.25);
     125  suite.equal_range(vec.begin(), vec.end(), correct.begin());
     126}
Note: See TracChangeset for help on using the changeset viewer.