99 void setup(
PredictorMap& predictors,
const std::map<Size, Int>& labels);
110 void predict(std::vector<Prediction>& predictions,
111 std::vector<Size> indexes = std::vector<Size>())
const;
121 void getFeatureWeights(std::map<String, double>& feature_weights)
const;
124 void writeXvalResults(
const String& path)
const;
131 std::vector<std::vector<struct svm_node> >
nodes_;
134 struct svm_problem data_;
137 struct svm_parameter svm_params_;
158 void scaleData_(PredictorMap& predictors)
const;
161 void convertData_(
const PredictorMap& predictors);
164 std::pair<double, double> chooseBestParameters_()
const;
167 void optimizeParameters_();
SVMPerformance performance_
Cross-validation results.
Definition: SimpleSVM.h:152
A more convenient string class.
Definition: String.h:57
std::vector< String > predictor_names_
Names of predictors in the model (excluding uninformative ones)
Definition: SimpleSVM.h:143
struct svm_model * model_
Pointer to SVM model (LIBSVM format)
Definition: SimpleSVM.h:140
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
std::vector< std::vector< struct svm_node > > nodes_
Values of predictors (LIBSVM format)
Definition: SimpleSVM.h:131
SVM prediction result.
Definition: SimpleSVM.h:74
std::vector< double > log2_gamma_
Definition: SimpleSVM.h:149
static void printNull_(const char *)
Dummy function to suppress LIBSVM output.
Definition: SimpleSVM.h:155
std::map< Int, double > probabilities
Predicted probabilities for different classes.
Definition: SimpleSVM.h:80
Simple interface to support vector machines for classification (via LIBSVM).
Definition: SimpleSVM.h:65
Size n_parts_
Number of partitions for cross-validation.
Definition: SimpleSVM.h:146
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Int label
Predicted class label.
Definition: SimpleSVM.h:77
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
std::vector< std::vector< double > > SVMPerformance
Classification performance for different param. combinations (C/gamma):
Definition: SimpleSVM.h:128
int Int
Signed integer type.
Definition: Types.h:102
std::map< String, std::vector< double > > PredictorMap
Mapping from predictor name to vector of predictor values.
Definition: SimpleSVM.h:71