Definition at line 1412 of file svm.cpp. References svm_parameter::C, Impala::Core::Array::C, svm_parameter::eps, info(), svm_problem::l, min, svm_parameter::nu, Solver::SolutionInfo::r, svm_parameter::shrinking, Solver_NU::Solve(), and svm_problem::y. Referenced by svm_train_one(). 01415 { 01416 int l = prob->l; 01417 double C = param->C; 01418 double *alpha2 = new double[2*l]; 01419 double *linear_term = new double[2*l]; 01420 schar *y = new schar[2*l]; 01421 int i; 01422 01423 double sum = C * param->nu * l / 2; 01424 for(i=0;i<l;i++) 01425 { 01426 alpha2[i] = alpha2[i+l] = min(sum,C); 01427 sum -= alpha2[i]; 01428 01429 linear_term[i] = - prob->y[i]; 01430 y[i] = 1; 01431 01432 linear_term[i+l] = prob->y[i]; 01433 y[i+l] = -1; 01434 } 01435 01436 Solver_NU s; 01437 s.Solve(2*l, SVR_Q(*prob,*param), linear_term, y, 01438 alpha2, C, C, param->eps, si, param->shrinking); 01439 01440 info("epsilon = %f\n",-si->r); 01441 01442 for(i=0;i<l;i++) 01443 alpha[i] = alpha2[i] - alpha2[i+l]; 01444 01445 delete[] alpha2; 01446 delete[] linear_term; 01447 delete[] y; 01448 }
Here is the call graph for this function:
|