10 #ifndef SVMCLASSIFICATION_H
11 #define SVMCLASSIFICATION_H
15 #include "../dependencies/libsvm/libsvm.h"
46 bool useScaling =
true,
47 bool useNullRejection =
false,
48 bool useAutoGamma =
true,
50 unsigned int degree = 3,
54 bool useCrossValidation =
false,
55 unsigned int kFoldValue = 10
82 T
run(
const std::vector<T> &inputVector)
override;
84 void reset()
override;
103 bool init(
KernelType kernelType,
SVMType svmType,
bool useScaling,
bool useNullRejection,
bool useAutoGamma,
109 bool useCrossValidation,
110 unsigned int kFoldValue
122 struct LIBSVM::svm_model *model;
123 struct LIBSVM::svm_parameter param;
124 struct LIBSVM::svm_problem problem;
129 std::vector<double> inRanges;
130 std::vector<double> inBases;
Definition: baseModel.h:42
Definition: svmClassification.h:19
T run(const std::vector< T > &inputVector) override
Definition: svmClassification.cpp:231
void train(const std::vector< trainingExampleTemplate< T > > &trainingSet) override
Definition: svmClassification.cpp:172
std::vector< size_t > getWhichInputs() const override
Definition: svmClassification.cpp:259
~svmClassification()
Definition: svmClassification.cpp:103
svmClassification(KernelType kernelType=LINEAR_KERNEL, SVMType svmType=C_SVC, bool useScaling=true, bool useNullRejection=false, bool useAutoGamma=true, float gamma=0.1, unsigned int degree=3, float coef0=0, float nu=0.5, float C=1, bool useCrossValidation=false, unsigned int kFoldValue=10)
Definition: svmClassification.cpp:17
bool init(KernelType kernelType, SVMType svmType, bool useScaling, bool useNullRejection, bool useAutoGamma, float gamma, unsigned int degree, float coef0, float nu, float C, bool useCrossValidation, unsigned int kFoldValue)
Definition: svmClassification.cpp:113
SVMType
Definition: svmClassification.h:21
@ C_SVC
Definition: svmClassification.h:21
@ NU_SVR
Definition: svmClassification.h:21
@ ONE_CLASS
Definition: svmClassification.h:21
@ NU_SVC
Definition: svmClassification.h:21
@ EPSILON_SVR
Definition: svmClassification.h:21
void reset() override
Definition: svmClassification.cpp:108
KernelType
Definition: svmClassification.h:22
@ LINEAR_KERNEL
Definition: svmClassification.h:22
@ PRECOMPUTED_KERNEL
Definition: svmClassification.h:22
@ SIGMOID_KERNEL
Definition: svmClassification.h:22
@ RBF_KERNEL
Definition: svmClassification.h:22
@ POLY_KERNEL
Definition: svmClassification.h:22
void getJSONDescription(Json::Value ¤tModel) override
Definition: svmClassification.cpp:266
size_t getNumInputs() const override
Definition: svmClassification.cpp:254
Definition: trainingExample.h:19