49 #endif //USE_GPL_SHOGUN
118 if (strcmp(name,
"LIBSVM_ONECLASS")==0)
122 SG_INFO(
"created SVMlibsvm object for oneclass\n")
124 else if (strcmp(name,
"LIBSVM_MULTICLASS")==0)
128 SG_INFO(
"created SVMlibsvm object for multiclass\n")
130 else if (strcmp(name,
"LIBSVM_NUMULTICLASS")==0)
134 SG_INFO(
"created SVMlibsvm object for multiclass\n")
137 else if (strcmp(name,
"SCATTERSVM_NO_BIAS_SVMLIGHT")==0)
141 SG_INFO(
"created ScatterSVM NO BIAS SVMLIGHT object\n")
143 #endif //USE_SVMLIGHT
144 else if (strcmp(name,
"SCATTERSVM_NO_BIAS_LIBSVM")==0)
148 SG_INFO(
"created ScatterSVM NO BIAS LIBSVM object\n")
150 else if (strcmp(name,
"SCATTERSVM_TESTRULE1")==0)
154 SG_INFO(
"created ScatterSVM TESTRULE1 object\n")
156 else if (strcmp(name,
"SCATTERSVM_TESTRULE2")==0)
160 SG_INFO(
"created ScatterSVM TESTRULE2 object\n")
162 else if (strcmp(name,
"LIBSVM_NU")==0)
166 SG_INFO(
"created SVMlibsvm object\n")
168 else if (strcmp(name,
"LIBSVM")==0)
172 SG_INFO(
"created SVMlibsvm object\n")
174 else if (strcmp(name,
"LARANK")==0)
178 SG_INFO(
"created LaRank object\n")
181 else if ((strcmp(name,
"LIGHT")==0) || (strcmp(name,
"SVMLIGHT")==0))
185 SG_INFO(
"created SVMLight object\n")
187 else if (strcmp(name,
"SVMLIGHT_ONECLASS")==0)
191 SG_INFO(
"created SVMLightOneClass object\n")
193 else if (strcmp(name,
"SVRLIGHT")==0)
197 SG_INFO(
"created SVRLight object\n")
199 #endif //USE_SVMLIGHT
200 #ifdef USE_GPL_SHOGUN
201 else if (strcmp(name,
"GPBTSVM")==0)
205 SG_INFO(
"created GPBT-SVM object\n")
207 #endif //USE_GPL_SHOGUN
208 else if (strcmp(name,
"MPDSVM")==0)
212 SG_INFO(
"created MPD-SVM object\n")
214 else if (strcmp(name,
"GNPPSVM")==0)
218 SG_INFO(
"created GNPP-SVM object\n")
220 else if (strcmp(name,
"GMNPSVM")==0)
224 SG_INFO(
"created GMNP-SVM object\n")
226 else if (strcmp(name,
"LIBSVR")==0)
230 SG_INFO(
"created SVRlibsvm object\n")
233 else if (strcmp(name,
"KERNELRIDGEREGRESSION")==0)
237 ui->ui_labels->get_train_labels());
241 else if (strcmp(name,
"PERCEPTRON")==0)
245 SG_INFO(
"created Perceptron object\n")
248 else if (strncmp(name,
"LIBLINEAR",9)==0)
252 if (strcmp(name,
"LIBLINEAR_L2R_LR")==0)
255 SG_INFO(
"created LibLinear l2 regularized logistic regression object\n")
257 else if (strcmp(name,
"LIBLINEAR_L2R_L2LOSS_SVC_DUAL")==0)
260 SG_INFO(
"created LibLinear l2 regularized l2 loss SVM dual object\n")
262 else if (strcmp(name,
"LIBLINEAR_L2R_L2LOSS_SVC")==0)
265 SG_INFO(
"created LibLinear l2 regularized l2 loss SVM primal object\n")
267 else if (strcmp(name,
"LIBLINEAR_L1R_L2LOSS_SVC")==0)
270 SG_INFO(
"created LibLinear l1 regularized l2 loss SVM primal object\n")
272 else if (strcmp(name,
"LIBLINEAR_L2R_L1LOSS_SVC_DUAL")==0)
275 SG_INFO(
"created LibLinear l2 regularized l1 loss dual SVM object\n")
278 SG_ERROR(
"unknown liblinear type\n")
287 else if (strcmp(name,
"LDA")==0)
291 SG_INFO(
"created LDA object\n")
294 else if (strcmp(name,
"LPM")==0)
302 SG_INFO(
"created LPM object\n")
304 else if (strcmp(name,
"LPBOOST")==0)
312 SG_INFO(
"created LPBoost object\n")
315 else if (strncmp(name,
"KNN", strlen(
"KNN"))==0)
319 SG_INFO(
"created KNN object\n")
321 else if (strncmp(name,
"KMEANS", strlen(
"KMEANS"))==0)
325 SG_INFO(
"created KMeans object\n")
327 else if (strncmp(name,
"HIERARCHICAL", strlen(
"HIERARCHICAL"))==0)
331 SG_INFO(
"created Hierarchical clustering object\n")
333 else if (strcmp(name,
"SVMLIN")==0)
340 SG_INFO(
"created SVMLin object\n")
342 #ifdef USE_GPL_SHOGUN
343 else if (strncmp(name,
"WDSVMOCAS", strlen(
"WDSVMOCAS"))==0)
349 ((CWDSVMOcas*)
classifier)->set_degree(d, from_d);
353 SG_INFO(
"created Weighted Degree Kernel SVM Ocas(OCAS) object of order %d (from order:%d)\n", d, from_d)
355 else if (strcmp(name,
"SVMOCAS")==0)
364 SG_INFO(
"created SVM Ocas(OCAS) object\n")
366 #endif //USE_GPL_SHOGUN
367 else if (strcmp(name,
"SVMSGD")==0)
372 SG_INFO(
"created SVM SGD object\n")
374 #ifdef USE_GPL_SHOGUN
375 else if (strcmp(name,
"SVMBMRM")==0 || (strcmp(name,
"SVMPERF")==0))
384 SG_INFO(
"created SVM Ocas(BMRM/PERF) object\n")
387 else if (strcmp(name,
"MKL_CLASSIFICATION")==0)
392 else if (strcmp(name,
"MKL_ONECLASS")==0)
397 else if (strcmp(name,
"MKL_MULTICLASS")==0)
402 else if (strcmp(name,
"MKL_REGRESSION")==0)
409 SG_ERROR(
"Unknown classifier %s.\n", name)
423 CLabels* trainlabels=
ui->ui_labels->get_train_labels();
425 SG_ERROR(
"No trainlabels available.\n")
427 CKernel* kernel=
ui->ui_kernel->get_kernel();
431 bool success=
ui->ui_kernel->init_kernel(
"TRAIN");
433 if (!success || !
ui->ui_kernel->is_initialized() || !kernel->
has_features())
434 SG_ERROR(
"Kernel not initialized / no train features available.\n")
438 SG_ERROR(
"Number of train labels (%d) and training vectors (%d) differs!\n", trainlabels->
get_num_labels(), num_vec)
472 trainlabels=
ui->ui_labels->get_train_labels();
474 SG_INFO(
"Training one class mkl.\n")
475 if (!trainlabels && !oneclass)
476 SG_ERROR(
"No trainlabels available.\n")
478 CKernel* kernel=
ui->ui_kernel->get_kernel();
482 bool success=
ui->ui_kernel->init_kernel(
"TRAIN");
483 if (!success || !
ui->ui_kernel->is_initialized() || !kernel->
has_features())
484 SG_ERROR(
"Kernel not initialized.\n")
488 SG_ERROR(
"Number of train labels (%d) and training vectors (%d) differs!\n", trainlabels->
get_num_labels(), num_vec)
527 bool result=mkl->
train();
542 trainlabels=
ui->ui_labels->get_train_labels();
544 SG_INFO(
"Training one class svm.\n")
545 if (!trainlabels && !oneclass)
546 SG_ERROR(
"No trainlabels available.\n")
548 CKernel* kernel=
ui->ui_kernel->get_kernel();
552 bool success=
ui->ui_kernel->init_kernel(
"TRAIN");
554 if (!success || !
ui->ui_kernel->is_initialized() || !kernel->
has_features())
555 SG_ERROR(
"Kernel not initialized / no train features available.\n")
559 SG_ERROR(
"Number of train labels (%d) and training vectors (%d) differs!\n", trainlabels->
get_num_labels(), num_vec)
636 if (!
ui->ui_distance->init_distance(
"TRAIN"))
637 SG_ERROR(
"Initializing distance with train features failed.\n")
647 ((
CKMeans*) classifier)->set_max_iter(max_iter);
648 result=((
CKMeans*) classifier)->train();
658 SG_ERROR(
"Unknown clustering type %d\n", type)
666 CLabels* trainlabels=
ui->ui_labels->get_train_labels();
675 if (!
ui->ui_distance->init_distance(
"TRAIN"))
676 SG_ERROR(
"Initializing distance with train features failed.\n")
683 SG_ERROR(
"No distance available.\n")
699 trainlabels=
ui->ui_labels->get_train_labels();
701 SG_ERROR(
"No trainlabels available.\n")
703 CKernel* kernel=
ui->ui_kernel->get_kernel();
707 bool success=
ui->ui_kernel->init_kernel(
"TRAIN");
709 if (!success || !
ui->ui_kernel->is_initialized() || !kernel->
has_features())
710 SG_ERROR(
"Kernel not initialized / no train features available.\n")
714 SG_ERROR(
"Number of train labels (%d) and training vectors (%d) differs!\n", trainlabels->
get_num_labels(), num_vec)
721 bool result=krr->
train();
732 CFeatures* trainfeatures=
ui->ui_features->get_train_features();
733 CLabels* trainlabels=
ui->ui_labels->get_train_labels();
737 SG_ERROR(
"No trainfeatures available.\n")
740 SG_ERROR(
"Trainfeatures not based on DotFeatures.\n")
755 SG_ERROR(
"LDA requires train features of class SIMPLE type REAL.\n")
760 #ifdef USE_GPL_SHOGUN
774 SG_ERROR(
"LPM and LPBOOST require trainfeatures of class SPARSE type REAL.\n")
784 #ifdef USE_GPL_SHOGUN
785 bool CGUIClassifier::train_wdocas()
787 CFeatures* trainfeatures=
ui->ui_features->get_train_features();
788 CLabels* trainlabels=
ui->ui_labels->get_train_labels();
793 SG_ERROR(
"No trainfeatures available.\n")
795 if (trainfeatures->get_feature_class()!=
C_STRING ||
796 trainfeatures->get_feature_type()!=
F_BYTE )
797 SG_ERROR("Trainfeatures are not of class STRING type BYTE.\n")
802 ((CWDSVMOcas*)
classifier)->set_labels(trainlabels);
808 #endif //USE_GPL_SHOGUN
816 FILE* model_file=fopen(filename,
"r");
817 REQUIRE(model_file != NULL,
"SVM/Classifier loading failed on file %s.\n", filename);
825 SG_DEBUG(
"file successfully read.\n")
829 SG_ERROR(
"SVM/Classifier creation/loading failed on file %s.\n", filename)
834 SG_ERROR(
"Opening file %s failed.\n", filename)
839 SG_ERROR(
"Type %s of SVM/Classifier unknown.\n", type)
851 FILE* file=fopen(param,
"w");
855 printf(
"writing to file %s failed!\n", param);
858 printf(
"successfully written classifier into \"%s\" !\n", param);
866 SG_ERROR(
"create classifier first\n")
907 SG_INFO(
"Disabling max_train_time.\n")
915 SG_ERROR(
"No regression method allocated\n")
921 SG_ERROR(
"Underlying method not capable of SV-regression\n")
948 if (weight_epsilon<0)
968 if (lambda<0 || lambda>1)
978 SG_ERROR(
"1 <= mkl_block_norm <= inf\n")
1039 SG_INFO(
"Enabling shrinking optimization.\n")
1041 SG_INFO(
"Disabling shrinking optimization.\n")
1050 SG_INFO(
"Enabling batch computation.\n")
1052 SG_INFO(
"Disabling batch computation.\n")
1061 SG_INFO(
"Enabling LINADD optimization.\n")
1063 SG_INFO(
"Disabling LINADD optimization.\n")
1072 SG_INFO(
"Enabling svm bias.\n")
1074 SG_INFO(
"Disabling svm bias.\n")
1083 SG_INFO(
"Enabling mkl interleaved optimization.\n")
1085 SG_INFO(
"Disabling mkl interleaved optimization.\n")
1095 SG_INFO(
"Enabling AUC maximization.\n")
1097 SG_INFO(
"Disabling AUC maximization.\n")
1141 #ifdef USE_GPL_SHOGUN
1146 SG_ERROR(
"unknown classifier type\n")
1155 CFeatures* trainfeatures=
ui->ui_features->get_train_features();
1156 CFeatures* testfeatures=
ui->ui_features->get_test_features();
1159 SG_ERROR(
"No kernelmachine available.\n")
1163 REQUIRE(
ui->ui_kernel->get_kernel(),
"No kernel set");
1164 if (
ui->ui_kernel->get_kernel()->get_kernel_type()!=
K_CUSTOM)
1166 if (
ui->ui_kernel->get_kernel()->get_kernel_type()==
K_COMBINED
1167 && ( !trainfeatures || !testfeatures ))
1169 SG_DEBUG(
"skipping initialisation of combined kernel "
1170 "as train/test features are unavailable\n")
1175 SG_ERROR(
"No training features available.\n")
1177 SG_ERROR(
"No test features available.\n")
1179 success=
ui->ui_kernel->init_kernel(
"TEST");
1183 if (!success || !
ui->ui_kernel->is_initialized())
1184 SG_ERROR(
"Kernel not initialized.\n")
1200 SG_INFO(
"Starting kernel machine testing.\n")
1206 int32_t& brows, int32_t& bcols,
1231 return get_svm(weights, rows, cols, bias, brows, bcols, idx);
1242 return get_linear(weights, rows, cols, bias, brows, bcols);
1252 SG_ERROR(
"unknown classifier type\n")
1267 int32_t& brows, int32_t& bcols, int32_t idx)
1283 weights=SG_MALLOC(
float64_t, rows*cols);
1285 for (int32_t i=0; i<rows; i++)
1299 int32_t& brows, int32_t& bcols)
1320 centers=SG_MALLOC(
float64_t, rows*cols);
1339 centers=SG_MALLOC(
float64_t, rows*cols);
1340 for (int32_t i=0; i<rows*cols; i++)
1347 SG_ERROR(
"internal error - unknown clustering type\n")
1355 int32_t& brows, int32_t& bcols)
1379 CFeatures* trainfeatures=
ui->ui_features->get_train_features();
1380 CFeatures* testfeatures=
ui->ui_features->get_test_features();
1384 SG_ERROR(
"no kernelmachine available\n")
1389 SG_ERROR(
"no training features available\n")
1395 SG_ERROR(
"no test features available\n")
1399 bool success=
ui->ui_distance->init_distance(
"TEST");
1401 if (!success || !
ui->ui_distance->is_initialized())
1403 SG_ERROR(
"distance not initialized\n")
1408 ui->ui_distance->get_distance());
1409 SG_INFO(
"starting distance machine testing\n")
1416 CFeatures* testfeatures=
ui->ui_features->get_test_features();
1420 SG_ERROR(
"no classifier available\n")
1425 SG_ERROR(
"no test features available\n")
1430 SG_ERROR(
"testfeatures not based on DotFeatures\n")
1435 SG_INFO(
"starting linear classifier testing\n")
1439 #ifdef USE_GPL_SHOGUN
1442 CFeatures* testfeatures=
ui->ui_features->get_test_features();
1451 SG_ERROR(
"no test features available\n")
1454 if (testfeatures->get_feature_class() !=
C_STRING ||
1455 testfeatures->get_feature_type() !=
F_BYTE )
1457 SG_ERROR(
"testfeatures not of class STRING type BYTE\n")
1465 #endif //USE_GPL_SHOGUN
1469 CFeatures* trainfeatures=
ui->ui_features->get_train_features();
1470 CFeatures* testfeatures=
ui->ui_features->get_test_features();
1478 if (!
ui->ui_kernel->is_initialized())
1480 SG_ERROR(
"kernel not initialized\n")
1484 if (!
ui->ui_kernel->get_kernel() ||
1485 ui->ui_kernel->get_kernel()->get_kernel_type()!=
K_CUSTOM)
1489 SG_ERROR(
"no training features available\n")
1495 SG_ERROR(
"no test features available\n")
1501 ui->ui_kernel->get_kernel());
1525 if (strncmp(solver,
"NEWTON", 6)==0)
1527 SG_INFO(
"Using NEWTON solver.\n")
1530 else if (strncmp(solver,
"DIRECT", 6)==0)
1532 SG_INFO(
"Using DIRECT solver\n")
1535 else if (strncmp(solver,
"BLOCK_NORM", 9)==0)
1537 SG_INFO(
"Using BLOCK_NORM solver\n")
1540 else if (strncmp(solver,
"ELASTICNET", 10)==0)
1542 SG_INFO(
"Using ELASTICNET solver\n")
1545 else if (strncmp(solver,
"AUTO", 4)==0)
1547 SG_INFO(
"Automagically determining solver.\n")
1551 else if (strncmp(solver,
"CPLEX", 5)==0)
1553 SG_INFO(
"USING CPLEX METHOD selected\n")
1558 else if (strncmp(solver,
"GLPK", 4)==0)
1560 SG_INFO(
"Using GLPK solver\n")
1565 SG_ERROR(
"Unknown solver type, %s (not compiled in?)\n", solver)
1574 if (strcmp(name,
"LIBSVM_ONECLASS")==0)
1578 SG_INFO(
"created SVMlibsvm object for oneclass\n")
1580 else if (strcmp(name,
"LIBSVM_NU")==0)
1584 SG_INFO(
"created SVMlibsvm object\n")
1586 else if (strcmp(name,
"LIBSVM")==0)
1590 SG_INFO(
"created SVMlibsvm object\n")
1593 else if ((strcmp(name,
"LIGHT")==0) || (strcmp(name,
"SVMLIGHT")==0))
1597 SG_INFO(
"created SVMLight object\n")
1599 else if (strcmp(name,
"SVMLIGHT_ONECLASS")==0)
1603 SG_INFO(
"created SVMLightOneClass object\n")
1605 else if (strcmp(name,
"SVRLIGHT")==0)
1609 SG_INFO(
"created SVRLight object\n")
1611 #endif //USE_SVMLIGHT
1612 #ifdef USE_GPL_SHOGUN
1613 else if (strcmp(name,
"GPBTSVM")==0)
1617 SG_INFO(
"created GPBT-SVM object\n")
1619 #endif //USE_GPL_SHOGUN
1620 else if (strcmp(name,
"MPDSVM")==0)
1624 SG_INFO(
"created MPD-SVM object\n")
1626 else if (strcmp(name,
"GNPPSVM")==0)
1630 SG_INFO(
"created GNPP-SVM object\n")
1632 else if (strcmp(name,
"LIBSVR")==0)
1636 SG_INFO(
"created SVRlibsvm object\n")
1640 SG_ERROR(
"Unknown SV-classifier %s.\n", name)
void set_epsilon(float64_t eps)
SGVector< float64_t > get_radiuses()
float distance(CJLCoverTreePoint p1, CJLCoverTreePoint p2, float64_t upper_bound)
void set_shrinking_enabled(bool enable)
bool set_perceptron_parameters(float64_t lernrate, int32_t maxiter)
bool set_svm_epsilon(float64_t epsilon)
int32_t get_num_support_vectors()
void set_bias_enabled(bool enable_bias)
void set_mkl_block_norm(float64_t q)
Class KernelRidgeRegression implements Kernel Ridge Regression - a regularized least square method fo...
bool get_trained_classifier(float64_t *&weights, int32_t &rows, int32_t &cols, float64_t *&bias, int32_t &brows, int32_t &bcols, int32_t idx=-1)
CLabels * classify_linear()
void set_max_train_time(float64_t t)
bool set_svm_shrinking_enabled(bool enabled)
bool train_mkl_multiclass()
bool set_svm_linadd_enabled(bool enabled)
bool train_knn(int32_t k=3)
MKLMulticlass is a class for L1-norm Multiclass MKL.
Template class StringFeatures implements a list of strings.
static char * skip_spaces(char *str)
SGVector< float64_t > get_merge_distances()
Class Distance, a base class for all the distances used in the Shogun toolbox.
void set_qpsize(int32_t qps)
bool set_constraint_generator(char *cg)
bool train_clustering(int32_t k=3, int32_t max_iter=1000)
void set_kernel(CKernel *k)
The class Labels models labels, i.e. class assignments of objects.
virtual int32_t get_num_labels() const =0
bool set_svm_mkl_parameters(float64_t weight_epsilon, float64_t C_mkl, float64_t mkl_norm)
void set_shrinking_enabled(bool enable)
float64_t perceptron_learnrate
bool set_do_auc_maximization(bool do_auc)
L2 regularized SVM with L2-loss using newton in the primal.
Class LPM trains a linear classifier called Linear Programming Machine, i.e. a SVM using a norm regu...
bool set_svm_nu(float64_t nu)
Trains a one class C SVM.
int32_t perceptron_maxiter
L1 regularized SVM with L2-loss using dual coordinate descent.
CLabels * classify_byte_linear()
virtual bool load_serializable(CSerializableFile *file, const char *prefix="")
CLabels * setup_auc_maximization(CLabels *labels)
void set_mkl_norm(float64_t norm)
A generic KernelMachine interface.
Multiple Kernel Learning for one-class-classification.
Agglomerative hierarchical single linkage clustering.
Features that support dot products among other operations.
virtual int32_t get_num_vec_lhs()
class LibSVMMultiClass. Does one vs one classification.
Multiple Kernel Learning for regression.
generic kernel multiclass
Class LDA implements regularized Linear Discriminant Analysis.
A generic DistanceMachine interface.
virtual void set_mkl_norm(float64_t norm)
void set_nu(float64_t nue)
bool classify_example(int32_t idx, float64_t &result)
bool set_svm_batch_computation_enabled(bool enabled)
CLabels * classify_distancemachine()
The AUC kernel can be used to maximize the area under the receiver operator characteristic curve (AUC...
void set_mkl_epsilon(float64_t eps)
void set_interleaved_optimization_enabled(bool enable)
Class SVRLight, performs support vector regression using SVMLight.
CLabels * classify_kernelmachine()
bool new_classifier(char *name, int32_t d=6, int32_t from_d=40)
bool set_svr_tube_epsilon(float64_t tube_epsilon)
Class SGObject is the base class of all shogun objects.
void set_constraint_generator(CSVM *s)
void set_batch_computation_enabled(bool enable)
KMeans clustering, partitions the data into k (a-priori specified) clusters.
void set_batch_computation_enabled(bool enable)
bool set_svm_max_qpsize(int32_t max_qpsize)
void set_nu(float64_t nue)
bool set_solver(char *solver)
SGMatrix< int32_t > get_cluster_pairs()
float64_t svm_weight_epsilon
L2 regularized linear logistic regression.
bool set_mkl_block_norm(float64_t mkl_bnorm)
This class provides an interface to the LibLinear library for large- scale linear learning focusing o...
bool set_mkl_interleaved_enabled(bool enabled)
Multiple Kernel Learning for two-class-classification.
void set_qpsize(int32_t qps)
L2 regularized SVM with L2-loss using dual coordinate descent.
void set_tube_epsilon(float64_t eps)
bool set_svm_bufsize(int32_t bufsize)
float64_t get_alpha(int32_t idx)
virtual EFeatureClass get_feature_class() const =0
Class KNN, an implementation of the standard k-nearest neigbor classifier.
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
Multiple Kernel Learning.
bool set_svm_bias_enabled(bool enabled)
virtual EMachineType get_classifier_type()
bool get_clustering(float64_t *&weights, int32_t &rows, int32_t &cols, float64_t *&bias, int32_t &brows, int32_t &bcols)
virtual SGVector< float64_t > get_w() const
int32_t get_support_vector(int32_t idx)
bool get_svm(float64_t *&weights, int32_t &rows, int32_t &cols, float64_t *&bias, int32_t &brows, int32_t &bcols, int32_t idx=-1)
Class LPBoost trains a linear classifier called Linear Programming Machine, i.e. a SVM using a norm ...
bool get_linear(float64_t *&weights, int32_t &rows, int32_t &cols, float64_t *&bias, int32_t &brows, int32_t &bcols)
bool train_linear(float64_t gamma=0)
Class LibSVR, performs support vector regression using LibSVM.
Class Perceptron implements the standard linear (online) perceptron.
ScatterSVM - Multiclass SVM.
virtual bool save_serializable(CSerializableFile *file, const char *prefix="")
CSVM * constraint_generator
all of classes and functions are contained in the shogun namespace
bool svm_do_auc_maximization
Class GMNPSVM implements a one vs. rest MultiClass SVM.
training with bias using test rule 2
The class Features is the base class of all feature objects.
training with bias using test rule 1
void set_linadd_enabled(bool enable)
virtual float64_t get_bias()
virtual bool train(CFeatures *data=NULL)
SGMatrix< float64_t > get_cluster_centers()
void set_mkl_epsilon(float64_t eps)
A generic Support Vector Machine Interface.
void set_linadd_enabled(bool enable)
void set_elasticnet_lambda(float64_t elasticnet_lambda)
the LaRank multiclass SVM machine This implementation uses LaRank algorithm from Bordes, Antoine, et al., 2007. "Solving multiclass support vector machines with LaRank."
void set_bias_enabled(bool enable_bias)
void set_epsilon(float64_t eps)
Matrix::Scalar max(Matrix m)
L2 regularized linear SVM with L1-loss using dual coordinate descent.
void set_kernel(CKernel *k)
bool has_property(EFeatureProperty p) const
float64_t svm_tube_epsilon
virtual bool has_features()
virtual void set_labels(CLabels *lab)
bool set_krr_tau(float64_t tau=1)
bool set_svm_C(float64_t C1, float64_t C2)
bool load(char *filename, char *type)
void set_solver_type(ESolverType st)
bool set_elasticnet_lambda(float64_t lambda)
bool svm_use_batch_computation
bool set_svm_qpsize(int32_t qpsize)
void set_C_mkl(float64_t C)
virtual EFeatureType get_feature_type() const =0
void set_C(float64_t c_neg, float64_t c_pos)
bool set_max_train_time(float64_t max)
void set_tube_epsilon(float64_t eps)
virtual CLabels * apply(CFeatures *data=NULL)