- Timestamp:
- Aug 29, 2006, 11:45:01 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/c++_tools/classifier/ConsensusInputRanker.cc
r560 r604 53 53 std::vector<size_t> ranks(input_rankers_.size()); 54 54 for (size_t j=0; j<input_rankers_.size(); j++) { 55 ranks[j]=input_rankers_[j].rank( i);55 ranks[j]=input_rankers_[j].rank()[i]; 56 56 } 57 57 medians[i].first = statistics::median(ranks); -
trunk/c++_tools/classifier/DataLookup2D.h
r592 r604 96 96 97 97 /// 98 /// @todo doc 99 /// 100 virtual const DataLookup2D* selected(const std::vector< size_t > &) const=0; 101 102 /// 98 103 /// @return sub-Lookup of the DataLookup2D 99 104 /// -
trunk/c++_tools/classifier/InputRanker.h
r482 r604 49 49 /// (index) of input ranked as number \a i 50 50 /// 51 inline size_t id(const size_t i) const {return id_[i];}51 inline const std::vector<size_t>& id(void) const {return id_;} 52 52 53 53 /// … … 55 55 /// id (column) \a i 56 56 /// 57 inline size_t rank(const size_t i) const {return rank_[i];}57 inline const std::vector<size_t> rank(void) const {return rank_;} 58 58 59 59 -
trunk/c++_tools/classifier/Makefile.am
r595 r604 30 30 DataLookup2D.cc \ 31 31 EnsembleBuilder.cc \ 32 FeatureSelector.cc \ 33 FeatureSelectorIR.cc \ 32 34 GaussianKernelFunction.cc \ 33 35 IGP.cc \ … … 57 59 DataLookup2D.h \ 58 60 EnsembleBuilder.h \ 61 FeatureSelector.h \ 62 FeatureSelectorIR.h \ 59 63 GaussianKernelFunction.h \ 60 64 IGP.h \ -
trunk/c++_tools/classifier/MatrixLookup.cc
r593 r604 124 124 125 125 const MatrixLookup* 126 MatrixLookup::selected(const std::vector<size_t>& i) const 127 { 128 return new MatrixLookup(*this,i, true); 129 } 130 131 132 133 const MatrixLookup* 126 134 MatrixLookup::training_data(const std::vector<size_t>& i) const 127 135 { -
trunk/c++_tools/classifier/MatrixLookup.h
r590 r604 161 161 virtual ~MatrixLookup(); 162 162 163 163 /// 164 /// @todo doc 165 /// 166 const MatrixLookup* selected(const std::vector<size_t>&) const; 167 164 168 /// 165 169 /// The created MatrixLookup corresponds to all rows and the -
trunk/c++_tools/classifier/MatrixLookupWeighted.cc
r595 r604 163 163 164 164 const MatrixLookupWeighted* 165 MatrixLookupWeighted::selected(const std::vector<size_t>& i) const 166 { 167 return new MatrixLookupWeighted(*this,i, true); 168 } 169 170 171 172 const MatrixLookupWeighted* 165 173 MatrixLookupWeighted::training_data(const std::vector<size_t>& i) const 166 174 { -
trunk/c++_tools/classifier/MatrixLookupWeighted.h
r597 r604 177 177 virtual ~MatrixLookupWeighted(); 178 178 179 179 /// 180 /// @todo doc 181 /// 182 const MatrixLookupWeighted* 183 selected(const std::vector<size_t>& index) const; 184 180 185 /// 181 186 /// The created MatrixLookupWeighted corresponds to all rows and the … … 190 195 /// undefined. 191 196 /// 192 const MatrixLookupWeighted* training_data(const std::vector<size_t>& index) const; 197 const MatrixLookupWeighted* 198 training_data(const std::vector<size_t>& index) const; 193 199 194 200 /// -
trunk/c++_tools/classifier/NCC.cc
r593 r604 108 108 double weight=(*weights_)(i,j); 109 109 if(score_) { 110 value=matrix_(ranker_->id( i),j);111 weight=(*weights_)(ranker_->id( i),j);110 value=matrix_(ranker_->id()[i],j); 111 weight=(*weights_)(ranker_->id()[i],j); 112 112 } 113 113 if(weight) { … … 135 135 value(i)=input(i); 136 136 if(ranker_) 137 value(i)=input(ranker_->id( i));137 value(i)=input(ranker_->id()[i]); 138 138 if(!std::isnan(value(i))) 139 139 w(i)=1.0; -
trunk/c++_tools/classifier/SVM.cc
r593 r604 84 84 index.reserve(nof_inputs); 85 85 for (size_t i=0; i<nof_inputs; i++) 86 index.push_back(ranker_->id( i));86 index.push_back(ranker_->id()[i]); 87 87 kernel_ = kernel.selected(index); 88 88 assert(kernel_->rows()==kernel.rows()); … … 143 143 index.reserve(nof_inputs_); 144 144 for (size_t i=0; i<nof_inputs_; i++) 145 index.push_back(ranker_->id( i));145 index.push_back(ranker_->id()[i]); 146 146 kernel_pointer = input_kernel.selected(index); 147 147 } -
trunk/test/inputranker_test.cc
r536 r604 39 39 statistics::ROC roc; 40 40 classifier::InputRanker ir(data,target,roc); 41 if (ir.id( 0)!=2 || ir.id(1)!=0 || ir.id(2)!=1){41 if (ir.id()[0]!=2 || ir.id()[1]!=0 || ir.id()[2]!=1){ 42 42 *error << "wrong id" << std::endl; 43 43 ok=false; 44 44 } 45 45 46 if (ir.rank( 0)!=1 || ir.rank(1)!=2 || ir.rank(2)!=0){46 if (ir.rank()[0]!=1 || ir.rank()[1]!=2 || ir.rank()[2]!=0){ 47 47 *error << "wrong rank" << std::endl; 48 48 ok=false;
Note: See TracChangeset
for help on using the changeset viewer.