Definition at line 1253 of file svm.cpp. References svm_parameter::eps, info(), svm_problem::l, svm_parameter::shrinking, Solver::Solve(), and svm_problem::y. Referenced by svm_train_one(). 01256 { 01257 int l = prob->l; 01258 double *minus_ones = new double[l]; 01259 schar *y = new schar[l]; 01260 01261 int i; 01262 01263 for(i=0;i<l;i++) 01264 { 01265 alpha[i] = 0; 01266 minus_ones[i] = -1; 01267 if(prob->y[i] > 0) y[i] = +1; else y[i]=-1; 01268 } 01269 01270 Solver s; 01271 s.Solve(l, SVC_Q(*prob,*param,y), minus_ones, y, 01272 alpha, Cp, Cn, param->eps, si, param->shrinking); 01273 01274 double sum_alpha=0; 01275 for(i=0;i<l;i++) 01276 sum_alpha += alpha[i]; 01277 01278 if (Cp==Cn) 01279 info("nu = %f\n", sum_alpha/(Cp*prob->l)); 01280 01281 for(i=0;i<l;i++) 01282 alpha[i] *= y[i]; 01283 01284 delete[] minus_ones; 01285 delete[] y; 01286 }
Here is the call graph for this function:
|