Changeset 820
- Timestamp:
- Mar 17, 2007, 10:54:52 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
- 2 moved
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 -
trunk/yat/classifier/DataLookup1D.cc
r815 r820 74 74 75 75 DataLookup1D::DataLookup1D(const utility::vector& v) 76 : column_vector_( true), index_(0), owner_(true)76 : column_vector_(false), index_(0), owner_(true) 77 77 { 78 78 utility::matrix* m = new utility::matrix(1,v.size()); -
trunk/yat/random/random.h
r818 r820 25 25 */ 26 26 27 #include "yat/statistics/Histogram.h" 28 27 29 #include <gsl/gsl_rng.h> 28 30 #include <gsl/gsl_randist.h> … … 32 34 namespace theplu { 33 35 namespace yat { 34 namespace statistics {35 class Histogram;36 }37 36 namespace random { 38 37 -
trunk/yat/statistics/AUC.cc
r810 r820 22 22 */ 23 23 24 #include " ROCScore.h"24 #include "AUC.h" 25 25 #include "yat/classifier/DataLookupWeighted1D.h" 26 26 #include "yat/classifier/Target.h" … … 37 37 namespace statistics { 38 38 39 ROCScore::ROCScore(bool absolute)39 AUC::AUC(bool absolute) 40 40 : Score(absolute) 41 41 { 42 42 } 43 43 44 double ROCScore::score(const classifier::Target& target,45 44 double AUC::score(const classifier::Target& target, 45 const utility::vector& value) const 46 46 { 47 47 assert(target.size()==value.size()); … … 57 57 58 58 59 double ROCScore::score(const classifier::Target& target,60 59 double AUC::score(const classifier::Target& target, 60 const classifier::DataLookupWeighted1D& value) const 61 61 { 62 62 assert(target.size()==value.size()); … … 73 73 74 74 75 double ROCScore::score(const classifier::Target& target,76 77 75 double AUC::score(const classifier::Target& target, 76 const utility::vector& value, 77 const utility::vector& weight) const 78 78 { 79 79 assert(target.size()==value.size()); … … 90 90 91 91 92 double 93 ROCScore::score(const MultiMap& m) const 92 double AUC::score(const MultiMap& m) const 94 93 { 95 94 double area=0; -
trunk/yat/statistics/AUC.h
r810 r820 1 #ifndef _theplu_yat_statistics_ roc_score_2 #define _theplu_yat_statistics_ roc_score_1 #ifndef _theplu_yat_statistics_auc_ 2 #define _theplu_yat_statistics_auc_ 3 3 4 4 // $Id$ … … 42 42 43 43 /// 44 /// @brief Class for Reciever Operating Characteristic.44 /// @brief Class calculating Area Under ROC Curve 45 45 /// 46 class ROCScore: public Score46 class AUC : public Score 47 47 { 48 48 … … 51 51 /// 52 52 /// 53 ROCScore(bool absolute=true);53 AUC(bool absolute=true); 54 54 55 55 /// Function taking \a value, \a target (+1 or -1) and vector -
trunk/yat/statistics/Makefile.am
r781 r820 24 24 25 25 noinst_LTLIBRARIES = libstatistics.la 26 libstatistics_la_SOURCES = A verager.cc AveragerPair.cc \26 libstatistics_la_SOURCES = AUC.cc Averager.cc AveragerPair.cc \ 27 27 AveragerWeighted.cc AveragerPairWeighted.cc Distance.cc \ 28 28 Euclidean.cc Fisher.cc FoldChange.cc Histogram.cc Pearson.cc \ 29 PearsonCorrelation.cc PearsonDistance.cc ROC.cc ROCScore.cc\29 PearsonCorrelation.cc PearsonDistance.cc ROC.cc \ 30 30 SAMScore.cc Score.cc SNR.cc tScore.cc tTest.cc \ 31 31 utility.cc WilcoxonFoldChange.cc … … 33 33 include_statisticsdir = $(includedir)/yat/statistics 34 34 35 include_statistics_HEADERS = A verager.h AveragerPair.h \35 include_statistics_HEADERS = AUC.h Averager.h AveragerPair.h \ 36 36 AveragerWeighted.h AveragerPairWeighted.h Distance.h Euclidean.h \ 37 37 Fisher.h \ 38 38 FoldChange.h Histogram.h Pearson.h PearsonCorrelation.h \ 39 PearsonDistance.h ROC.h ROCScore.h\39 PearsonDistance.h ROC.h \ 40 40 SAMScore.h Score.h SNR.h tScore.h tTest.h \ 41 41 utility.h WilcoxonFoldChange.h
Note: See TracChangeset
for help on using the changeset viewer.