Changeset 820 for trunk/test
- Timestamp:
- Mar 17, 2007, 10:54:52 PM (16 years ago)
- Location:
- trunk/test
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/consensus_inputranker_test.cc
r781 r820 23 23 24 24 #include "yat/classifier/ConsensusInputRanker.h" 25 #include "yat/statistics/ ROCScore.h"25 #include "yat/statistics/AUC.h" 26 26 #include "yat/utility/matrix.h" 27 27 #include "yat/classifier/MatrixLookup.h" … … 59 59 60 60 61 theplu::yat::statistics:: ROCScoreroc;61 theplu::yat::statistics::AUC roc; 62 62 theplu::yat::classifier::CrossValidationSampler sampler(target,30,3); 63 63 *error << "Building Consensus_Inputranker" << std::endl; -
trunk/test/data_lookup_1d_test.cc
r680 r820 25 25 #include "yat/classifier/DataLookup1D.h" 26 26 #include "yat/classifier/MatrixLookup.h" 27 #include "yat/classifier/utility.h" 27 28 28 29 … … 54 55 *error << "Testing Lookup Classes" << std::endl; 55 56 bool ok = true; 57 58 56 59 57 60 if(!std::numeric_limits<double>::has_quiet_NaN) { … … 166 169 } 167 170 std::remove("data/tmp_test_datalookup1D.txt"); 168 171 *error << "\n"; 172 173 DataLookup1D dl(v5); 174 utility::vector v8; 175 classifier::convert(dl, v8); 176 if (!v5.equal(v8,0.0)) { 177 ok = false; 178 *error << "Error: Creating a DataLookup1D(utility::vector)\n" 179 << "and classifier::convert(DataLookup, utility::vector)\n" 180 << "does not give back original vector\n" 181 << "orginal: " << v5 << "\n" 182 << "DataLookup1D: " << dl << "\n" 183 << "final result: " << v8 << "\n" 184 << std::endl; 185 } 186 169 187 return end_test(error,ok); 170 188 } -
trunk/test/distance_test.cc
r816 r820 58 58 b(2) = 1; 59 59 60 *error << "testing PearsonDistance" << std::endl; 60 61 statistics::Distance* distance = new statistics::PearsonDistance; 61 62 ok = ok && test(a, b, distance, 1.5, error); 62 63 delete distance; 63 64 65 *error << "testing Euclidean" << std::endl; 64 66 distance = new statistics::Euclidean; 65 67 ok = ok && test(a, b, distance, 5, error); … … 79 81 std::ostream* error) 80 82 { 83 // distance between a and a is always zero 81 84 if (a!=b && !test(a, a, distance, 0, error)) 82 85 return false; 86 else 87 *error << "Testing that distance between x and x is zero" 88 << std::endl; 83 89 if ((*distance)(a,b) != facit) { 84 90 *error << "Error: calculating distance with utility::vector\n" -
trunk/test/feature_selection_test.cc
r781 r820 24 24 #include "yat/classifier/FeatureSelectorIR.h" 25 25 #include "yat/classifier/FeatureSelectorRandom.h" 26 #include "yat/statistics/ ROCScore.h"26 #include "yat/statistics/AUC.h" 27 27 28 28 #include <fstream> … … 45 45 bool ok = true; 46 46 47 statistics:: ROCScoreroc;47 statistics::AUC roc; 48 48 classifier::FeatureSelectorIR f(roc, 12); 49 49 classifier::FeatureSelectorRandom f2(12); -
trunk/test/inputranker_test.cc
r781 r820 23 23 24 24 #include "yat/classifier/InputRanker.h" 25 #include "yat/statistics/ ROCScore.h"25 #include "yat/statistics/AUC.h" 26 26 #include "yat/utility/matrix.h" 27 27 #include "yat/classifier/MatrixLookup.h" … … 57 57 is.close(); 58 58 59 statistics:: ROCScoreroc;59 statistics::AUC roc; 60 60 classifier::InputRanker ir(data,target,roc); 61 61 if (ir.id()[0]!=2 || ir.id()[1]!=0 || ir.id()[2]!=1){ -
trunk/test/score_test.cc
r781 r820 25 25 #include "yat/statistics/FoldChange.h" 26 26 #include "yat/statistics/Pearson.h" 27 #include "yat/statistics/ ROCScore.h"27 #include "yat/statistics/AUC.h" 28 28 #include "yat/statistics/SAMScore.h" 29 29 #include "yat/statistics/tScore.h" … … 52 52 bool ok = true; 53 53 54 *error << "testing ROCScore" << std::endl;54 *error << "testing AUC" << std::endl; 55 55 utility::vector value(31); 56 56 std::vector<std::string> label(31,"negative"); … … 60 60 for (size_t i=0; i<value.size(); i++) 61 61 value(i)=i; 62 statistics:: ROCScore roc;63 double area = roc.score(target, value);62 statistics::AUC auc; 63 double area = auc.score(target, value); 64 64 if (area!=1.0){ 65 *error << "test_ roc: area is " << area << " should be 1.0"65 *error << "test_auc: area is " << area << " should be 1.0" 66 66 << std::endl; 67 67 ok = false; … … 69 69 target.set_binary(0,false); 70 70 target.set_binary(1,true); 71 area = roc.score(target, value);71 area = auc.score(target, value); 72 72 if (area!=1.0){ 73 *error << "test_ roc: area is " << area << " should be 1.0"73 *error << "test_auc: area is " << area << " should be 1.0" 74 74 << std::endl; 75 75 ok = false; … … 97 97 ok=false; 98 98 } 99 area = roc.score(target2,vec);99 area = auc.score(target2,vec); 100 100 if (area<correct_area(i)-tol || area>correct_area(i)+tol){ 101 101 *error << "test_roc: area is " << area << " should be " … … 108 108 for (size_t i=0; i<data.rows(); i++){ 109 109 utility::vector vec(data,i); 110 area = roc.score(target2, vec, weight);110 area = auc.score(target2, vec, weight); 111 111 if (area<correct_area(i)-tol || area>correct_area(i)+tol){ 112 112 *error << "test_roc: weighted area is " << area << " should be " -
trunk/test/subset_generator_test.cc
r781 r820 32 32 #include "yat/classifier/SVM.h" 33 33 #include "yat/classifier/NCC.h" 34 #include "yat/statistics/ ROCScore.h"34 #include "yat/statistics/AUC.h" 35 35 #include "yat/statistics/PearsonDistance.h" 36 36 #include "yat/utility/matrix.h" … … 79 79 classifier::CrossValidationSampler sampler(target, 30, 3); 80 80 81 statistics:: ROCScorescore;81 statistics::AUC score; 82 82 classifier::FeatureSelectorIR fs(score, 96, 0); 83 83 *error << "building SubsetGenerator" << std::endl; … … 97 97 for (size_t i = 0; i<out.size(); ++i) 98 98 out(i)=ensemble_svm.validate()[0][i].mean(); 99 statistics:: ROCScoreroc;99 statistics::AUC roc; 100 100 *error << roc.score(target,out) << std::endl; 101 101
Note: See TracChangeset
for help on using the changeset viewer.