26 LIBSVR_SOLVER_TYPE st)
35 case LIBSVR_EPSILON_SVR:
42 SG_ERROR(
"CLibSVR::CLibSVR(): Unknown solver type!\n");
70 SG_ERROR(
"Number of training vectors does not match number of labels\n")
76 struct svm_node* x_space;
83 x_space=SG_MALLOC(
struct svm_node, 2*
problem.l);
85 for (int32_t i=0; i<
problem.l; i++)
90 x_space[2*i+1].index=-1;
93 int32_t weights_label[2]={-1,+1};
98 case LIBSVR_EPSILON_SVR:
99 param.svm_type=EPSILON_SVR;
102 param.svm_type=NU_SVR;
109 param.kernel_type = LINEAR;
122 param.weight_label = weights_label;
123 param.weight = weights;
126 const char* error_msg = svm_check_parameter(&
problem,&
param);
138 int32_t num_sv=
model->l;
146 for (int32_t i=0; i<num_sv; i++)
156 svm_destroy_model(
model);
virtual bool init(CFeatures *lhs, CFeatures *rhs)
virtual bool train_machine(CFeatures *data=NULL)
virtual ELabelType get_label_type() const =0
Real Labels are real-valued labels.
The class Labels models labels, i.e. class assignments of objects.
virtual int32_t get_num_labels() const =0
real valued labels (e.g. for regression, classifier outputs)
virtual int32_t get_num_vectors() const =0
float64_t m_max_train_time
void set_nu(float64_t nue)
virtual EMachineType get_classifier_type()
void set_bias(float64_t bias)
bool set_alpha(int32_t idx, float64_t val)
void set_objective(float64_t v)
bool set_support_vector(int32_t idx, int32_t val)
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
LIBSVR_SOLVER_TYPE solver_type
virtual const char * get_name() const
A generic Support Vector Machine Interface.
void set_kernel(CKernel *k)
virtual void set_labels(CLabels *lab)
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)