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* );