Changeset 828 for trunk/test/consensus_inputranker_test.cc
- Timestamp:
- Mar 19, 2007, 11:15:43 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/consensus_inputranker_test.cc
r820 r828 28 28 #include "yat/classifier/CrossValidationSampler.h" 29 29 #include "yat/classifier/IRRank.h" 30 #include "yat/statistics/VectorFunction.h" 30 31 31 32 #include <cstdlib> … … 63 64 *error << "Building Consensus_Inputranker" << std::endl; 64 65 theplu::yat::classifier::IRRank retrieve; 65 theplu::yat::classifier::ConsensusInputRanker cir(sampler,data,roc,retrieve); 66 *error << "Done" << std::endl; 66 theplu::yat::statistics::Median median; 67 theplu::yat::classifier::ConsensusInputRanker cir(retrieve,median); 68 cir.add(sampler,data,roc); 67 69 70 *error << "test ids... "; 68 71 if (cir.id(0)!=2 || cir.id(1)!=0 || cir.id(2)!=1){ 69 *error << "incorrect id" << endl; 70 ok = false; 71 } 72 73 if (cir.rank(0)!=1 || cir.rank(1)!=2 || cir.rank(2)!=0){ 74 *error << "incorrect rank" << endl; 72 *error << "\nincorrect id for weighted" << endl; 75 73 ok=false; 76 74 } 75 else 76 *error << "ok." << std::endl; 77 78 *error << "test ranks... "; 79 if (cir.rank(0)!=1 || cir.rank(1)!=2 || cir.rank(2)!=0){ 80 *error << "\nincorrect rank for weighted" << endl; 81 ok=false; 82 } 83 else 84 *error << "ok." << std::endl; 77 85 78 86 theplu::yat::utility::matrix flag(data.rows(),data.columns(),1); 79 87 // Peter, fix weighted version instead 80 theplu::yat::classifier::ConsensusInputRanker cir2(sampler,data,roc,retrieve); 88 theplu::yat::classifier::ConsensusInputRanker cir2(retrieve,median); 89 cir2.add(sampler,data,roc); 81 90 91 *error << "test ids... "; 82 92 if (cir2.id(0)!=2 || cir2.id(1)!=0 || cir2.id(2)!=1){ 83 *error << " incorrect id for weighted" << endl;93 *error << "\nincorrect id for weighted" << endl; 84 94 ok=false; 85 95 } 96 else 97 *error << "ok." << std::endl; 86 98 99 *error << "test ranks... "; 87 100 if (cir2.rank(0)!=1 || cir2.rank(1)!=2 || cir2.rank(2)!=0){ 88 *error << " incorrect rank for weighted" << endl;101 *error << "\nincorrect rank for weighted" << endl; 89 102 ok=false; 90 103 } 104 else 105 *error << "ok." << std::endl; 91 106 92 107 if (error!=&std::cerr)
Note: See TracChangeset
for help on using the changeset viewer.