Changeset 493
- Timestamp:
- Jan 9, 2006, 3:01:40 PM (17 years ago)
- Location:
- trunk/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/classifier/SVM.cc
r491 r493 4 4 #include <c++_tools/classifier/SVM.h> 5 5 6 #include <c++_tools/classifier/ KernelLookup.h>6 #include <c++_tools/classifier/DataLookup2D.h> 7 7 #include <c++_tools/gslapi/matrix.h> 8 8 #include <c++_tools/gslapi/vector.h> … … 137 137 } 138 138 139 SVM::SVM(const KernelLookup& kernel, const Target& target)139 SVM::SVM(const DataLookup2D& kernel, const Target& target) 140 140 : SupervisedClassifier(kernel,target), 141 141 alpha_(target.size(),0), … … 150 150 tolerance_(0.00000001) 151 151 { 152 } 153 154 SupervisedClassifier* SVM::make_classifier(const DataLookup2D& data, 155 const Target& target) const 156 { 157 SVM* sc = new SVM(data,target); 158 //Copy those variables possible to modify from outside 159 return sc; 152 160 } 153 161 -
trunk/lib/classifier/SVM.h
r491 r493 108 108 /// the SVM is no longer defined. 109 109 /// 110 SVM(const KernelLookup&, const Target&); 110 SVM(const DataLookup2D&, const Target&); 111 112 /// 113 /// @todo doc 114 /// 115 SupervisedClassifier* 116 make_classifier(const DataLookup2D&, const Target&) const; 111 117 112 118 /// … … 152 158 { trained_=false; alpha_=gslapi::vector(target_.size(),0); } 153 159 154 155 156 157 158 159 160 /// 161 /// Training the SVM following Platt's SMO, with Keerti's 162 /// modifacation. Minimizing \f$ \frac{1}{2}\sum 163 /// y_iy_j\alpha_i\alpha_j(K_{ij}+\frac{1}{C_i}\delta_{ij}) \f$, 164 /// which corresponds to minimizing \f$ \sum w_i^2+\sum C_i\xi_i^2 165 /// \f$. 160 166 /// 161 167 bool train(); … … 169 175 SVM(const SVM&); 170 176 171 ///172 /// Default constructor (not implemented)173 ///174 SVM(void);175 176 177 /// 177 178 /// Calculates bounds for alpha2 … … 207 208 double bias_; 208 209 double C_inverse_; 209 const KernelLookup& kernel_;210 const DataLookup2D& kernel_; 210 211 unsigned long int max_epochs_; 211 212 gslapi::vector output_; -
trunk/lib/statistics/tScore.cc
r492 r493 58 58 double diff = positive.mean() - negative.mean(); 59 59 double s2=(positive.sum_xx_centered()+negative.sum_xx_centered())/ 60 (positive.n()+negative.n()-2 ;60 (positive.n()+negative.n()-2); 61 61 t_=diff/sqrt(s2*(1.0/positive.sum_w()+1.0/negative.sum_w())); 62 62 assert(0);
Note: See TracChangeset
for help on using the changeset viewer.