84 typedef std::map<String, std::pair<double, double> >
ScaleMap;
113 void setup(
PredictorMap& predictors,
const std::map<Size, double>& outcomes,
bool classification =
true);
124 void predict(std::vector<Prediction>& predictions,
125 std::vector<Size> indexes = std::vector<Size>())
const;
136 void predict(
PredictorMap& predictors, std::vector<Prediction>& predictions)
const;
146 void getFeatureWeights(std::map<String, double>& feature_weights)
const;
149 void writeXvalResults(
const String& path)
const;
161 std::vector<std::vector<struct svm_node> >
nodes_;
164 struct svm_problem data_;
167 struct svm_parameter svm_params_;
179 std::vector<double> log2_C_, log2_gamma_,
log2_p_;
191 void scaleData_(PredictorMap& predictors);
194 void convertData_(
const PredictorMap& predictors);
197 std::tuple<double, double, double> chooseBestParameters_(
bool higher_better)
const;
200 void optimizeParameters_(
bool classification);
SVMPerformance performance_
Cross-validation results.
Definition: SimpleSVM.h:185
A more convenient string class.
Definition: String.h:58
std::vector< std::vector< std::vector< double > > > SVMPerformance
Classification (or regression) performance for different param. combinations (C/gamma/p): ...
Definition: SimpleSVM.h:158
std::map< String, std::pair< double, double > > ScaleMap
Mapping from predictor name to predictor min and max.
Definition: SimpleSVM.h:84
std::vector< String > predictor_names_
Names of predictors in the model (excluding uninformative ones)
Definition: SimpleSVM.h:173
SVM/SVR prediction result.
Definition: SimpleSVM.h:87
struct svm_model * model_
Pointer to SVM model (LIBSVM format)
Definition: SimpleSVM.h:170
double outcome
Predicted class label (or regression value)
Definition: SimpleSVM.h:90
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::vector< std::vector< struct svm_node > > nodes_
Values of predictors (LIBSVM format)
Definition: SimpleSVM.h:161
ScaleMap scaling_
Mapping from predictor name to predictor min and max.
Definition: SimpleSVM.h:182
std::vector< double > log2_p_
Definition: SimpleSVM.h:179
static void printNull_(const char *)
Dummy function to suppress LIBSVM output.
Definition: SimpleSVM.h:188
std::map< double, double > probabilities
Class label (or regression value) and their predicted probabilities.
Definition: SimpleSVM.h:93
Simple interface to support vector machines for classification and regression (via LIBSVM)...
Definition: SimpleSVM.h:75
Size n_parts_
Number of partitions for cross-validation.
Definition: SimpleSVM.h:176
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
std::map< String, std::vector< double > > PredictorMap
Mapping from predictor name to vector of predictor values.
Definition: SimpleSVM.h:81