Changeset 779 for trunk/test


Ignore:
Timestamp:
Mar 5, 2007, 7:58:30 PM (15 years ago)
Author:
Peter
Message:

Refs #101

Location:
trunk/test
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/Makefile.am

    r723 r779  
    77# Copyright (C) 2005 Jari Häkkinen, Peter Johansson
    88# Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
     9# Copyright (C) 2007 Peter Johansson
    910#
    1011# This file is part of the yat library, http://lev.thep.lu.se/trac/yat
     
    2930  ensemble_test feature_selection_test fileutil_test inputranker_test \
    3031  kernel_test kernel_lookup_test matrix_test matrix_lookup_test       \
    31   ncc_test nni_test pca_test regression_test rnd_test score_test      \
     32  ncc_test nni_test pca_test regression_test rnd_test roc_test \
     33  score_test      \
    3234  statistics_test subset_generator_test svd_test svm_test target_test \
    3335  utility_test vector_test
     
    6062regression_test_SOURCES = regression_test.cc
    6163rnd_test_SOURCES = rnd_test.cc
     64roc_test_SOURCES = roc_test.cc
    6265score_test_SOURCES = score_test.cc
    6366statistics_test_SOURCES = statistics_test.cc
  • trunk/test/consensus_inputranker_test.cc

    r680 r779  
    2323
    2424#include "yat/classifier/ConsensusInputRanker.h"
    25 #include "yat/statistics/ROC.h"
     25#include "yat/statistics/ROCscore.h"
    2626#include "yat/utility/matrix.h"
    2727#include "yat/classifier/MatrixLookup.h"
     
    5959
    6060 
    61   theplu::yat::statistics::ROC roc;
     61  theplu::yat::statistics::ROCscore roc;
    6262  theplu::yat::classifier::CrossValidationSampler sampler(target,30,3);
    6363  *error << "Building Consensus_Inputranker" << std::endl;
  • trunk/test/feature_selection_test.cc

    r680 r779  
    2424#include "yat/classifier/FeatureSelectorIR.h"
    2525#include "yat/classifier/FeatureSelectorRandom.h"
    26 #include "yat/statistics/ROC.h"
     26#include "yat/statistics/ROCscore.h"
    2727
    2828#include <fstream>
     
    4545  bool ok = true;
    4646
    47   statistics::ROC roc;
     47  statistics::ROCscore roc;
    4848  classifier::FeatureSelectorIR f(roc, 12);
    4949  classifier::FeatureSelectorRandom f2(12);
  • trunk/test/inputranker_test.cc

    r680 r779  
    2323
    2424#include "yat/classifier/InputRanker.h"
    25 #include "yat/statistics/ROC.h"
     25#include "yat/statistics/ROCscore.h"
    2626#include "yat/utility/matrix.h"
    2727#include "yat/classifier/MatrixLookup.h"
     
    5757  is.close();
    5858
    59   statistics::ROC roc;
     59  statistics::ROCscore roc;
    6060  classifier::InputRanker ir(data,target,roc);
    6161  if (ir.id()[0]!=2 || ir.id()[1]!=0 || ir.id()[2]!=1){
  • trunk/test/score_test.cc

    r747 r779  
    2525#include "yat/statistics/FoldChange.h"
    2626#include "yat/statistics/Pearson.h"
    27 #include "yat/statistics/ROC.h"
    28 #include "yat/statistics/SAM.h"
     27#include "yat/statistics/ROCscore.h"
     28#include "yat/statistics/SAMScore.h"
    2929#include "yat/statistics/tScore.h"
    3030#include "yat/statistics/WilcoxonFoldChange.h"
     
    5252  bool ok = true;
    5353
    54   *error << "testing ROC" << std::endl;
     54  *error << "testing ROCscore" << std::endl;
    5555  utility::vector value(31);
    5656  std::vector<std::string> label(31,"negative");
     
    6060  for (size_t i=0; i<value.size(); i++)
    6161    value(i)=i;
    62   statistics::ROC roc;
     62  statistics::ROCscore roc;
    6363  double area = roc.score(target, value);
    6464  if (area!=1.0){
     
    7373    *error << "test_roc: area is " << area << " should be 1.0"
    7474           << std::endl;
    75     ok = false;
    76   }
    77  
    78   double p = roc.p_value();
    79   double p_matlab = 0.00000115;
    80   if (p/p_matlab > 1.01 | p/p_matlab < 0.99){
    81     *error << "get_p_approx: p-value not correct" << std::endl;
    82     ok = false;
    83   }
    84   roc.minimum_size() = 20;
    85   p = roc.p_value();
    86   if (p > pow(10, -8.0) | p < pow(10, -9.0)){
    87     *error << "get_p_exact: p-value not correct" << std::endl;
    8875    ok = false;
    8976  }
     
    141128  statistics::WilcoxonFoldChange wfc(true);
    142129
    143   *error << "testing SAM" << std::endl;
    144   statistics::SAM sam(1.0,true);
     130  *error << "testing SAMScore" << std::endl;
     131  statistics::SAMScore sam(1.0,true);
    145132
    146133
  • trunk/test/subset_generator_test.cc

    r722 r779  
    3232#include "yat/classifier/SVM.h"
    3333#include "yat/classifier/NCC.h"
    34 #include "yat/statistics/ROC.h"
     34#include "yat/statistics/ROCscore.h"
    3535#include "yat/statistics/PearsonDistance.h"
    3636#include "yat/utility/matrix.h"
     
    7878  classifier::CrossValidationSampler sampler(target, 30, 3);
    7979
    80   statistics::ROC score;
     80  statistics::ROCscore score;
    8181  classifier::FeatureSelectorIR fs(score, 96, 0);
    8282  *error << "building SubsetGenerator" << std::endl;
     
    9696  for (size_t i = 0; i<out.size(); ++i)
    9797    out(i)=ensemble_svm.validate()[0][i].mean();
    98   statistics::ROC roc;
     98  statistics::ROCscore roc;
    9999  *error << roc.score(target,out) << std::endl;
    100100
Note: See TracChangeset for help on using the changeset viewer.