Definition at line 1374 of file svm.cpp. References svm_parameter::C, svm_parameter::eps, info(), svm_problem::l, svm_parameter::p, svm_parameter::shrinking, Solver::Solve(), and svm_problem::y. Referenced by svm_train_one(). 01377 { 01378 int l = prob->l; 01379 double *alpha2 = new double[2*l]; 01380 double *linear_term = new double[2*l]; 01381 schar *y = new schar[2*l]; 01382 int i; 01383 01384 for(i=0;i<l;i++) 01385 { 01386 alpha2[i] = 0; 01387 linear_term[i] = param->p - prob->y[i]; 01388 y[i] = 1; 01389 01390 alpha2[i+l] = 0; 01391 linear_term[i+l] = param->p + prob->y[i]; 01392 y[i+l] = -1; 01393 } 01394 01395 Solver s; 01396 s.Solve(2*l, SVR_Q(*prob,*param), linear_term, y, 01397 alpha2, param->C, param->C, param->eps, si, param->shrinking); 01398 01399 double sum_alpha = 0; 01400 for(i=0;i<l;i++) 01401 { 01402 alpha[i] = alpha2[i] - alpha2[i+l]; 01403 sum_alpha += fabs(alpha[i]); 01404 } 01405 info("nu = %f\n",sum_alpha/(param->C*l)); 01406 01407 delete[] alpha2; 01408 delete[] linear_term; 01409 delete[] y; 01410 }
Here is the call graph for this function:
|