14 using namespace shogun;
51 SG_ERROR(
"Number of training vectors does not match number of labels\n");
57 struct svm_node* x_space;
66 for (int32_t i=0; i<
problem.l; i++)
71 x_space[2*i+1].index=-1;
74 int32_t weights_label[2]={-1,+1};
77 param.svm_type=EPSILON_SVR;
78 param.kernel_type = LINEAR;
91 param.weight_label = weights_label;
92 param.weight = weights;
95 const char* error_msg = svm_check_parameter(&
problem,&
param);
107 int32_t num_sv=
model->l;
115 for (int32_t i=0; i<num_sv; i++)
125 svm_destroy_model(
model);
virtual bool init(CFeatures *lhs, CFeatures *rhs)
virtual bool train_machine(CFeatures *data=NULL)
The class Labels models labels, i.e. class assignments of objects.
virtual int32_t get_num_vectors() const =0
void set_bias(float64_t bias)
bool set_alpha(int32_t idx, float64_t val)
void set_objective(float64_t v)
float64_t get_label(int32_t idx)
bool set_support_vector(int32_t idx, int32_t val)
The class Features is the base class of all feature objects.
virtual EClassifierType get_classifier_type()
A generic Support Vector Machine Interface.
void set_kernel(CKernel *k)
virtual void set_labels(CLabels *lab)
#define SG_MALLOC(type, len)
void set_C(float64_t c_neg, float64_t c_pos)
bool create_new_model(int32_t num)
void set_tube_epsilon(float64_t eps)