56 std::vector<std::vector<std::pair<Int, double> > >
sequences;
61 SVMData(std::vector<std::vector<std::pair<Int, double> > >& seqs, std::vector<double>& lbls);
65 bool store(
const String& filename)
const;
67 bool load(
const String& filename);
158 void setParameter(SVM_parameter_type type,
Int value);
166 void setParameter(SVM_parameter_type type,
double value);
173 Int train(
struct svm_problem* problem);
192 void saveModel(std::string modelFilename)
const;
202 void loadModel(std::string modelFilename);
209 void predict(
struct svm_problem* problem, std::vector<double>& predicted_labels);
216 void predict(
const SVMData& problem, std::vector<double>& results);
257 Int getIntParameter(SVM_parameter_type type);
286 double getDoubleParameter(SVM_parameter_type type);
293 static void createRandomPartitions(svm_problem* problem,
Size number, std::vector<svm_problem*>& partitions);
300 static void createRandomPartitions(
const SVMData& problem,
302 std::vector<SVMData>& problems);
306 static svm_problem* mergePartitions(
const std::vector<svm_problem*>& problems,
Size except);
311 static void mergePartitions(
const std::vector<SVMData>& problems,
321 void predict(
const std::vector<svm_node*>& vectors, std::vector<double>& predicted_rts);
327 static void getLabels(svm_problem* problem, std::vector<double>& labels);
333 double performCrossValidation(svm_problem* problem_ul,
335 const bool is_labeled,
336 const std::map<SVM_parameter_type, double>& start_values_map,
337 const std::map<SVM_parameter_type, double>& step_sizes_map,
338 const std::map<SVM_parameter_type, double>& end_values_map,
339 Size number_of_partitions,
341 std::map<SVM_parameter_type, double>& best_parameters,
342 bool additive_step_sizes =
true,
344 String performances_file_name =
"performances.txt",
345 bool mcc_as_performance_measure =
false);
357 double getSVRProbability();
374 static double kernelOligo(
const std::vector<std::pair<int, double> >& x,
375 const std::vector<std::pair<int, double> >& y,
376 const std::vector<double>& gauss_table,
377 int max_distance = -1);
386 static double kernelOligo(
const svm_node* x,
const svm_node* y,
const std::vector<double>& gauss_table,
double sigma_square = 0,
Size max_distance = 50);
391 void getSignificanceBorders(svm_problem* data, std::pair<double, double>& borders,
double confidence = 0.95,
Size number_of_runs = 5,
Size number_of_partitions = 5,
double step_size = 0.01,
Size max_iterations = 1000000);
396 void getSignificanceBorders(
const SVMData& data,
397 std::pair<double, double>& sigmas,
398 double confidence = 0.95,
399 Size number_of_runs = 5,
400 Size number_of_partitions = 5,
401 double step_size = 0.01,
402 Size max_iterations = 1000000);
410 double getPValue(
double sigma1,
double sigma2, std::pair<double, double> point);
421 void getDecisionValues(svm_problem* data, std::vector<double>& decision_values);
429 void scaleData(svm_problem* data,
Int max_scale_value = -1);
431 static void calculateGaussTable(
Size border_length,
double sigma, std::vector<double>& gauss_table);
440 svm_problem* computeKernelMatrix(svm_problem* problem1, svm_problem* problem2);
449 svm_problem* computeKernelMatrix(
const SVMData& problem1,
const SVMData& problem2);
455 void setTrainingSample(svm_problem* training_sample);
460 void setTrainingSample(
SVMData& training_sample);
471 void getSVCProbabilities(
struct svm_problem* problem, std::vector<double>& probabilities, std::vector<double>& prediction_labels);
476 void setWeights(
const std::vector<Int>& weight_labels,
const std::vector<double>& weights);
485 bool nextGrid_(
const std::vector<double>& start_values,
486 const std::vector<double>& step_sizes,
487 const std::vector<double>& end_values,
488 const bool additive_step_sizes,
489 std::vector<double>& actual_values);
491 Size getNumberOfEnclosedPoints_(
double m1,
double m2,
const std::vector<std::pair<double, double> >& points);
496 void initParameters_();
503 static void printToVoid_(
const char* );
the C parameter of the svm
Definition: SVMWrapper.h:95
A more convenient string class.
Definition: String.h:57
SVMData training_data_
Definition: SVMWrapper.h:515
svm_model * model_
Definition: SVMWrapper.h:506
svm_problem * training_problem_
Definition: SVMWrapper.h:514
Serves as a wrapper for the libsvm.
Definition: SVMWrapper.h:79
svm_problem * training_set_
Definition: SVMWrapper.h:513
the epsilon parameter for epsilon-SVR
Definition: SVMWrapper.h:97
SVM_kernel_type
Kernel type.
Definition: SVMWrapper.h:105
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
std::vector< std::vector< std::pair< Int, double > > > sequences
Definition: SVMWrapper.h:56
Size border_length_
Definition: SVMWrapper.h:512
Size kernel_type_
Definition: SVMWrapper.h:511
svm_parameter * param_
Definition: SVMWrapper.h:505
Data structure used in SVMWrapper.
Definition: SVMWrapper.h:54
the svm type cab be NU_SVR or EPSILON_SVR
Definition: SVMWrapper.h:92
std::vector< double > gauss_table_
Definition: SVMWrapper.h:509
Definition: SVMWrapper.h:100
the gamma parameter of the POLY, RBF and SIGMOID kernel
Definition: SVMWrapper.h:98
Definition: SVMWrapper.h:99
double sigma_
Definition: SVMWrapper.h:507
the degree for the polynomial- kernel
Definition: SVMWrapper.h:94
std::vector< double > labels
Definition: SVMWrapper.h:57
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
std::vector< std::vector< double > > gauss_tables_
Definition: SVMWrapper.h:510
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
int Int
Signed integer type.
Definition: Types.h:102
std::vector< double > sigmas_
Definition: SVMWrapper.h:508
the nu parameter for nu-SVR
Definition: SVMWrapper.h:96
the kernel type
Definition: SVMWrapper.h:93
SVM_parameter_type
Parameters for the svm to be set from outside.
Definition: SVMWrapper.h:90