Ignore:
Timestamp:
Jan 13, 2009, 11:09:53 AM (12 years ago)
Author:
Jari Häkkinen
Message:

Addresses #425

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization_test.cc

    r1573 r1708  
    33/*
    44  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2009 Jari Häkkinen
    56
    67  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2425#include "yat/normalizer/Centralizer.h"
    2526#include "yat/normalizer/ColumnNormalizer.h"
    26 #include "yat/normalizer/CubicSplineNormalizer.h"
    2727#include "yat/normalizer/Gauss.h"
     28#include "yat/normalizer/qQuantileNormalizer.h"
    2829#include "yat/normalizer/QuantileNormalizer.h"
    2930#include "yat/normalizer/RowNormalizer.h"
     
    4445void test_centralizer(test::Suite&);
    4546void test_column_normalize(test::Suite&);
    46 void test_cubicspline_normalize(test::Suite&);
    4747void test_gauss_normalize(test::Suite&);
     48void test_qquantile_normalize(test::Suite&);
    4849void test_quantile_normalize(test::Suite&);
    4950void test_row_normalize(test::Suite&);
     
    5960  test_centralizer(suite);
    6061  test_column_normalize(suite);
    61   test_cubicspline_normalize(suite);
     62  test_qquantile_normalize(suite);
    6263  test_quantile_normalize(suite);
    6364  test_gauss_normalize(suite);
     
    120121
    121122
    122 void test_cubicspline_normalize(test::Suite& suite)
    123 {
    124   suite.err() << "Testing CubicSplineNormalizer\n";
    125   std::string data(test::filename("data/cubicspline.data"));
     123void test_qquantile_normalize(test::Suite& suite)
     124{
     125  using namespace normalizer;
     126
     127  suite.err() << "Testing qQuantileNormalizer\n";
     128  std::string data(test::filename("data/normalization_test.data"));
    126129  if (utility::FileUtil(data.c_str()).permissions("r")) {
    127130    suite.add(false);
     
    132135
    133136  utility::Matrix m(data_stream);
     137  utility::Matrix result(m.rows(),m.columns());
     138
     139  // testing number of parts boundary conditions
     140  qQuantileNormalizer(m.column_const_view(0),m.rows());
     141  qQuantileNormalizer(m.column_const_view(0),2);
     142
     143  qQuantileNormalizer qqn(m.column_const_view(0),9);  // first column as target
     144  qqn(m,result);
    134145}
    135146
Note: See TracChangeset for help on using the changeset viewer.