15 using namespace shogun;
18 :
CSVM(), model(NULL), solver_type(LIBSVM_C_SVC)
23 :
CSVM(), model(NULL), solver_type(st)
29 :
CSVM(C, k, lab), model(NULL), solver_type(st)
41 struct svm_node* x_space;
50 SG_ERROR(
"%s::train_machine(): Number of training vectors (%d) does"
51 " not match number of labels (%d)\n",
get_name(),
64 SG_ERROR(
"Number of training vectors does not match length of linear term\n")
74 for (
int i=0; i!=
problem.l; i++)
82 x_space=SG_MALLOC(
struct svm_node, 2*
problem.l);
84 for (int32_t i=0; i<
problem.l; i++)
89 x_space[2*i+1].index=-1;
92 int32_t weights_label[2]={-1,+1};
101 param.svm_type=C_SVC;
104 param.svm_type=NU_SVC;
111 param.kernel_type = LINEAR;
124 param.weight_label = weights_label;
125 param.weight = weights;
128 const char* error_msg = svm_check_parameter(&
problem, &
param);
140 int32_t num_sv=
model->l;
149 for (int32_t i=0; i<num_sv; i++)
163 svm_destroy_model(
model);