Changeset 1158
- Timestamp:
- Feb 26, 2008, 2:49:38 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/ncc_test.cc
r1157 r1158 22 22 */ 23 23 24 #include "yat/classifier/IGP.h"25 24 #include "yat/classifier/Kernel_MEV.h" 26 25 #include "yat/classifier/KernelLookup.h" -
trunk/yat/classifier/IGP.h
r1120 r1158 51 51 52 52 public: 53 /// 54 /// Constructor taking the training data and the target vector and 55 /// as input. 56 /// 57 IGP(const MatrixLookup&, const Target&); 58 59 53 60 /// 54 61 /// Constructor taking the training data, the target vector and 55 62 /// the distance measure as input. 56 63 /// 57 IGP(const MatrixLookup&, const Target& );64 IGP(const MatrixLookup&, const Target&, const Distance&); 58 65 59 66 /// … … 69 76 70 77 private: 78 void calculate(); 79 71 80 utility::Vector igp_; 72 81 Distance distance_; … … 83 92 : matrix_(data), target_(target) 84 93 { 94 calculate(); 95 } 96 97 template <typename Distance> 98 IGP<Distance>::IGP(const MatrixLookup& data, const Target& target, const Distance& dist) 99 : matrix_(data), target_(target), distance_(dist) 100 { 101 calculate(); 102 } 103 104 105 template <typename Distance> 106 IGP<Distance>::~IGP() 107 { 108 } 109 110 template <typename Distance> 111 void IGP<Distance>::calculate() 112 { 85 113 utility::yat_assert<std::runtime_error>(target_.size()==matrix_.columns()); 86 114 … … 108 136 } 109 137 } 110 111 template <typename Distance>112 IGP<Distance>::~IGP()113 {114 }115 138 116 139 -
trunk/yat/classifier/KNN.h
r1157 r1158 63 63 64 64 /// 65 /// @brief Constructor 66 /// 67 KNN(const Distance&); 68 69 70 /// 65 71 /// @brief Destructor 66 72 /// … … 141 147 KNN<Distance, NeighborWeighting>::KNN() 142 148 : SupervisedClassifier(),data_(0),target_(0),k_(3) 149 { 150 } 151 152 template <typename Distance, typename NeighborWeighting> 153 KNN<Distance, NeighborWeighting>::KNN(const Distance& dist) 154 : SupervisedClassifier(),data_(0),target_(0),k_(3), distance_(dist) 143 155 { 144 156 } -
trunk/yat/classifier/NCC.h
r1157 r1158 69 69 NCC(void); 70 70 71 /// 72 /// @brief Constructor 73 /// 74 NCC(const Distance&); 75 71 76 72 77 /// … … 123 128 NCC<Distance>::NCC() 124 129 : SupervisedClassifier(), centroids_(0), centroids_nan_(false) 130 { 131 } 132 133 template <typename Distance> 134 NCC<Distance>::NCC(const Distance& dist) 135 : SupervisedClassifier(), centroids_(0), centroids_nan_(false), distance_(dist) 125 136 { 126 137 }
Note: See TracChangeset
for help on using the changeset viewer.