- Timestamp:
- Feb 11, 2007, 10:26:35 AM (16 years ago)
- Location:
- trunk/yat/classifier
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/Kernel.h
r720 r746 146 146 147 147 148 ///149 /// Created Kernel is built from selected features in data. The150 /// @a index corresponds to which rows in data to use for the151 /// calculation of the returned Kernel.152 ///153 /// @return Dynamically allocated Kernel based on selected features154 ///155 /// @Note Returns a dynamically allocated Kernel, which has156 /// to be deleted by the caller to avoid memory leaks.157 ///158 /// @todo remove this function159 virtual const Kernel* selected(const std::vector<size_t>& index) const=0;160 161 148 /** 162 149 \brief number of samples -
trunk/yat/classifier/KernelLookup.cc
r720 r746 143 143 KernelLookup::selected(const std::vector<size_t>& inputs) const 144 144 { 145 const Kernel* kernel = kernel_->selected(inputs); 146 return new KernelLookup(*kernel, row_index_, column_index_, true); 145 const Kernel* kernel; 146 if (kernel_->weighted()){ 147 const MatrixLookupWeighted* ml = 148 dynamic_cast<const MatrixLookupWeighted*>(data()); 149 assert(ml); 150 const MatrixLookupWeighted* ms = 151 new MatrixLookupWeighted(*ml,inputs,true); 152 kernel = kernel_->make_kernel(*ms, false); 153 } 154 else { 155 const MatrixLookup* m = 156 dynamic_cast<const MatrixLookup*>(data()); 157 assert(m); 158 // matrix with selected features 159 const MatrixLookup* ms = new MatrixLookup(*m,inputs,true); 160 kernel = kernel_->make_kernel(*ms,true); 161 } 162 return new KernelLookup(*kernel, true); 147 163 } 148 164 -
trunk/yat/classifier/Kernel_MEV.cc
r680 r746 76 76 77 77 78 const Kernel_MEV* Kernel_MEV::selected(const std::vector<size_t>& index) const79 {80 return new Kernel_MEV(*this, index);81 }82 83 84 78 85 79 }}} // of namespace classifier, yat, and theplu -
trunk/yat/classifier/Kernel_MEV.h
r680 r746 106 106 107 107 108 ///109 /// @see Kernel_MEV(const Kernel_MEV&, const std::vector<size_t>&);110 111 ///112 /// @note returns dynamically allocated pointer that must be113 /// deleted by the caller to avoid memory leaks.114 ///115 const Kernel_MEV* selected(const std::vector<size_t>& index) const;116 117 108 private: 118 109 /// -
trunk/yat/classifier/Kernel_SEV.cc
r680 r746 94 94 95 95 96 const Kernel* Kernel_SEV::selected(const std::vector<size_t>& index) const97 {98 return new Kernel_SEV(*this, index);99 }100 101 102 96 }}} // of namespace classifier, yat, and theplu -
trunk/yat/classifier/Kernel_SEV.h
r680 r746 102 102 103 103 104 ///105 /// @todo doc106 ///107 const Kernel* selected(const std::vector<size_t>& index) const;108 109 104 private: 110 105 /// -
trunk/yat/classifier/MatrixLookupWeighted.h
r720 r746 165 165 /// underlying matrix to avoid multiple lookups. 166 166 /// 167 /// If @a row_vectors is true the new MatrixLookupWeighted will beconsist167 /// If @a row_vectors is true the new MatrixLookupWeighted will consist 168 168 /// of the row vectors defined by @a index. This means that the 169 169 /// created MatrixLookupWeighted will fullfill: 170 170 /// \f$ MatrixLookupWeighted(i,j)=ml(i,index[j])\f$ 171 171 /// 172 /// If @a row_vectors is false the new MatrixLookupWeighted will beconsist172 /// If @a row_vectors is false the new MatrixLookupWeighted will consist 173 173 /// of the rolumn vectors defined by @a index. This means that the 174 174 /// created MatrixLookupWeighted will fullfill:
Note: See TracChangeset
for help on using the changeset viewer.