OTB
9.0.0
Orfeo Toolbox
|
#include <otbLibSVMMachineLearningModel.h>
Public Types | |
enum | ConfidenceMode { CM_INDEX, CM_PROBA, CM_HYPER } |
typedef Superclass::ConfidenceValueType | ConfidenceValueType |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef Superclass::InputListSampleType | InputListSampleType |
typedef Superclass::InputSampleType | InputSampleType |
typedef Superclass::InputValueType | InputValueType |
typedef itk::SmartPointer< Self > | Pointer |
typedef Superclass::ProbaSampleType | ProbaSampleType |
typedef LibSVMMachineLearningModel | Self |
typedef MachineLearningModel< TInputValue, TTargetValue > | Superclass |
typedef Superclass::TargetListSampleType | TargetListSampleType |
typedef Superclass::TargetSampleType | TargetSampleType |
typedef Superclass::TargetValueType | TargetValueType |
Public Types inherited from otb::MachineLearningModel< TInputValue, TTargetValue > | |
typedef MachineLearningModel | Self |
typedef itk::Object | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef MLMSampleTraits< TInputValue >::ValueType | InputValueType |
typedef MLMSampleTraits< TInputValue >::SampleType | InputSampleType |
typedef itk::Statistics::ListSample< InputSampleType > | InputListSampleType |
typedef MLMTargetTraits< TTargetValue >::ValueType | TargetValueType |
typedef MLMTargetTraits< TTargetValue >::SampleType | TargetSampleType |
typedef itk::Statistics::ListSample< TargetSampleType > | TargetListSampleType |
typedef MLMTargetTraits< double >::ValueType | ConfidenceValueType |
typedef MLMTargetTraits< double >::SampleType | ConfidenceSampleType |
typedef itk::Statistics::ListSample< ConfidenceSampleType > | ConfidenceListSampleType |
typedef itk::VariableLengthVector< double > | ProbaSampleType |
typedef itk::Statistics::ListSample< ProbaSampleType > | ProbaListSampleType |
static Pointer | New () |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
virtual const char * | GetNameOfClass () const |
void | Train () override |
void | Save (const std::string &filename, const std::string &name="") override |
void | Load (const std::string &filename, const std::string &name="") override |
Classification model file compatibility tests | |
struct svm_model * | m_Model |
struct svm_problem | m_Problem |
struct svm_parameter | m_Parameters |
bool | m_ParameterOptimization |
unsigned int | m_CVFolders |
double | m_InitialCrossValidationAccuracy |
double | m_FinalCrossValidationAccuracy |
unsigned int | m_CoarseOptimizationNumberOfSteps |
unsigned int | m_FineOptimizationNumberOfSteps |
ConfidenceMode | m_ConfidenceMode |
std::vector< double > | m_TmpTarget |
bool | CanReadFile (const std::string &) override |
bool | CanWriteFile (const std::string &) override |
otbSetSVMParameterMacro (SVMType, svm_type, int) | |
int | GetSVMType (void) const |
otbSetSVMParameterMacro (KernelType, kernel_type, int) | |
int | GetKernelType (void) const |
otbSetSVMParameterMacro (PolynomialKernelDegree, degree, int) | |
int | GetPolynomialKernelDegree (void) const |
otbSetSVMParameterMacro (KernelGamma, gamma, double) | |
double | GetKernelGamma (void) const |
otbSetSVMParameterMacro (KernelCoef0, coef0, double) | |
double | GetKernelCoef0 (void) const |
otbSetSVMParameterMacro (C, C, double) | |
double | GetC (void) const |
virtual void | SetParameterOptimization (bool _arg) |
virtual bool | GetParameterOptimization () |
void | SetDoProbabilityEstimates (bool prob) |
bool | GetDoProbabilityEstimates (void) const |
bool | HasProbabilities (void) const |
otbSetSVMParameterMacro (Epsilon, eps, double) | |
double | GetEpsilon (void) const |
otbSetSVMParameterMacro (P, p, double) | |
double | GetP (void) const |
otbSetSVMParameterMacro (Nu, nu, double) | |
double | GetNu (void) const |
void | DoShrinking (bool s) |
bool | GetDoShrinking (void) const |
void | SetCacheSize (int cSize) |
int | GetCacheSize (void) const |
virtual void | SetCVFolders (unsigned int _arg) |
virtual unsigned int | GetCVFolders () |
virtual double | GetInitialCrossValidationAccuracy () |
virtual double | GetFinalCrossValidationAccuracy () |
virtual void | SetCoarseOptimizationNumberOfSteps (unsigned int _arg) |
virtual unsigned int | GetCoarseOptimizationNumberOfSteps () |
virtual void | SetFineOptimizationNumberOfSteps (unsigned int _arg) |
virtual unsigned int | GetFineOptimizationNumberOfSteps () |
void | SetConfidenceMode (unsigned int mode) |
virtual unsigned int | GetConfidenceMode () |
unsigned int | GetNumberOfKernelParameters () |
double | CrossValidation (void) |
unsigned int | GetNumberOfSupportVectors (void) const |
unsigned int | GetNumberOfClasses (void) const |
LibSVMMachineLearningModel () | |
~LibSVMMachineLearningModel () override | |
TargetSampleType | DoPredict (const InputSampleType &input, ConfidenceValueType *quality=nullptr, ProbaSampleType *proba=nullptr) const override |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
LibSVMMachineLearningModel (const Self &)=delete | |
void | operator= (const Self &)=delete |
void | BuildProblem (void) |
void | ConsistencyCheck (void) |
void | DeleteProblem (void) |
void | DeleteModel (void) |
void | OptimizeParameters (void) |
Definition at line 33 of file otbLibSVMMachineLearningModel.h.
typedef Superclass::ConfidenceValueType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::ConfidenceValueType |
Definition at line 48 of file otbLibSVMMachineLearningModel.h.
typedef itk::SmartPointer<const Self> otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::ConstPointer |
Definition at line 40 of file otbLibSVMMachineLearningModel.h.
typedef Superclass::InputListSampleType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::InputListSampleType |
Definition at line 44 of file otbLibSVMMachineLearningModel.h.
typedef Superclass::InputSampleType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::InputSampleType |
Definition at line 43 of file otbLibSVMMachineLearningModel.h.
typedef Superclass::InputValueType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::InputValueType |
Definition at line 42 of file otbLibSVMMachineLearningModel.h.
typedef itk::SmartPointer<Self> otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::Pointer |
Definition at line 39 of file otbLibSVMMachineLearningModel.h.
typedef Superclass::ProbaSampleType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::ProbaSampleType |
Definition at line 49 of file otbLibSVMMachineLearningModel.h.
typedef LibSVMMachineLearningModel otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::Self |
Standard class typedefs.
Definition at line 37 of file otbLibSVMMachineLearningModel.h.
typedef MachineLearningModel<TInputValue, TTargetValue> otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::Superclass |
Definition at line 38 of file otbLibSVMMachineLearningModel.h.
typedef Superclass::TargetListSampleType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::TargetListSampleType |
Definition at line 47 of file otbLibSVMMachineLearningModel.h.
typedef Superclass::TargetSampleType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::TargetSampleType |
Definition at line 46 of file otbLibSVMMachineLearningModel.h.
typedef Superclass::TargetValueType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::TargetValueType |
Definition at line 45 of file otbLibSVMMachineLearningModel.h.
enum otb::LibSVMMachineLearningModel::ConfidenceMode |
enum to choose the way confidence is computed CM_INDEX : compute the difference between highest and second highest probability CM_PROBA : returns probabilities for all classes The given pointer needs to store 'nbClass' values This mode requires that ConfidenceValueType is double CM_HYPER : returns hyperplanes distances* The given pointer needs to store 'nbClass * (nbClass-1) / 2' values This mode requires that ConfidenceValueType is double
Enumerator | |
---|---|
CM_INDEX | |
CM_PROBA | |
CM_HYPER |
Definition at line 59 of file otbLibSVMMachineLearningModel.h.
|
protected |
Constructor
Definition at line 35 of file otbLibSVMMachineLearningModel.hxx.
References otb::Utils::PrintNothing().
|
overrideprotected |
Destructor
Definition at line 73 of file otbLibSVMMachineLearningModel.hxx.
|
privatedelete |
Container to hold the SVM model itself
|
private |
Container to hold the SVM model itself
Definition at line 285 of file otbLibSVMMachineLearningModel.hxx.
References otbMsgDebugMacro.
|
overridevirtual |
Is the input model file readable and compatible with the corresponding classifier ?
Implements otb::MachineLearningModel< TInputValue, TTargetValue >.
Definition at line 227 of file otbLibSVMMachineLearningModel.hxx.
|
overridevirtual |
Is the input model file writable and compatible with the corresponding classifier ?
Implements otb::MachineLearningModel< TInputValue, TTargetValue >.
Definition at line 254 of file otbLibSVMMachineLearningModel.hxx.
|
private |
Container to hold the SVM model itself
Definition at line 345 of file otbLibSVMMachineLearningModel.hxx.
References otbMsgDebugMacro.
virtual::itk::LightObject::Pointer otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::CreateAnother | ( | void | ) | const |
Run-time type information (and related methods).
double otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::CrossValidation | ( | void | ) |
Container to hold the SVM model itself
Definition at line 426 of file otbLibSVMMachineLearningModel.hxx.
|
private |
Container to hold the SVM model itself
Definition at line 386 of file otbLibSVMMachineLearningModel.hxx.
|
private |
Container to hold the SVM model itself
Definition at line 363 of file otbLibSVMMachineLearningModel.hxx.
|
overrideprotected |
Predict values using the model
Definition at line 104 of file otbLibSVMMachineLearningModel.hxx.
|
inline |
Use the shrinking heuristics for the training
Definition at line 202 of file otbLibSVMMachineLearningModel.h.
|
inline |
Get the C parameter for the training for C_SVC, EPSILON_SVR and NU_SVR
Definition at line 149 of file otbLibSVMMachineLearningModel.h.
|
inline |
Get the cache size in MB for the training
Definition at line 224 of file otbLibSVMMachineLearningModel.h.
|
virtual |
Container to hold the SVM model itself
|
virtual |
Container to hold the SVM model itself
|
virtual |
Container to hold the SVM model itself
|
inline |
Get Do probability estimates boolean
Definition at line 164 of file otbLibSVMMachineLearningModel.h.
|
inline |
Get Use the shrinking heuristics for the training boolea
Definition at line 210 of file otbLibSVMMachineLearningModel.h.
|
inline |
Get the tolerance for the stopping criterion for the training
Definition at line 176 of file otbLibSVMMachineLearningModel.h.
|
virtual |
Container to hold the SVM model itself
|
virtual |
Container to hold the SVM model itself
|
virtual |
Container to hold the SVM model itself
|
inline |
Get the coef0 parameter for poly/sigmoid kernels
Definition at line 140 of file otbLibSVMMachineLearningModel.h.
|
inline |
Get the gamma parameter for poly/rbf/sigmoid kernels
Definition at line 131 of file otbLibSVMMachineLearningModel.h.
|
inline |
Get the kernel type
Definition at line 113 of file otbLibSVMMachineLearningModel.h.
|
virtual |
Run-time type information (and related methods).
|
inline |
Set the Nu parameter for the training
Definition at line 194 of file otbLibSVMMachineLearningModel.h.
|
inline |
Container to hold the SVM model itself
Definition at line 266 of file otbLibSVMMachineLearningModel.h.
unsigned int otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::GetNumberOfKernelParameters |
Container to hold the SVM model itself
Definition at line 396 of file otbLibSVMMachineLearningModel.hxx.
|
inline |
Return number of support vectors
Definition at line 258 of file otbLibSVMMachineLearningModel.h.
|
inline |
Get the value of p for EPSILON_SVR
Definition at line 185 of file otbLibSVMMachineLearningModel.h.
|
virtual |
Container to hold the SVM model itself
|
inline |
Get the degree of the polynomial kernel
Definition at line 122 of file otbLibSVMMachineLearningModel.h.
|
inline |
Get the SVM type (C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR)
Definition at line 100 of file otbLibSVMMachineLearningModel.h.
bool otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::HasProbabilities | ( | void | ) | const |
Test if the model has probabilities
Definition at line 267 of file otbLibSVMMachineLearningModel.hxx.
|
overridevirtual |
Load the model from file
Implements otb::MachineLearningModel< TInputValue, TTargetValue >.
Definition at line 213 of file otbLibSVMMachineLearningModel.hxx.
|
static |
Run-time type information (and related methods).
|
privatedelete |
Container to hold the SVM model itself
|
private |
Container to hold the SVM model itself
Definition at line 453 of file otbLibSVMMachineLearningModel.hxx.
References otb::ExhaustiveExponentialOptimizer::New(), otbMsgDebugMacro, and otbMsgDevMacro.
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro | ( | C | , |
C | , | ||
double | |||
) |
Set the C parameter for the training for C_SVC, EPSILON_SVR and C_SVR
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro | ( | Epsilon | , |
eps | , | ||
double | |||
) |
Set the tolerance for the stopping criterion for the training
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro | ( | KernelCoef0 | , |
coef0 | , | ||
double | |||
) |
Set the coef0 parameter for poly/sigmoid kernels
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro | ( | KernelGamma | , |
gamma | , | ||
double | |||
) |
Set the gamma parameter for poly/rbf/sigmoid kernels
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro | ( | KernelType | , |
kernel_type | , | ||
int | |||
) |
Set the kernel type to LINEAR, POLY, RBF, SIGMOID linear: u'v polynomial: (gamma*u'*v + coef0)^degree radial basis function: exp(-gamma|u-v|^2) sigmoid: tanh(gamma*u'*v + coef0)
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro | ( | Nu | , |
nu | , | ||
double | |||
) |
Set the Nu parameter for the training
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro | ( | P | , |
p | , | ||
double | |||
) |
Set the value of p for EPSILON_SVR
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro | ( | PolynomialKernelDegree | , |
degree | , | ||
int | |||
) |
Set the degree of the polynomial kernel
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro | ( | SVMType | , |
svm_type | , | ||
int | |||
) |
Set the SVM type to C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR
|
overrideprotected |
PrintSelf method
Definition at line 260 of file otbLibSVMMachineLearningModel.hxx.
|
overridevirtual |
Save the model to file
Implements otb::MachineLearningModel< TInputValue, TTargetValue >.
Definition at line 204 of file otbLibSVMMachineLearningModel.hxx.
|
inline |
Set the cache size in MB for the training
Definition at line 216 of file otbLibSVMMachineLearningModel.h.
|
virtual |
Container to hold the SVM model itself
|
inline |
Container to hold the SVM model itself
Definition at line 242 of file otbLibSVMMachineLearningModel.h.
|
virtual |
Container to hold the SVM model itself
|
inline |
Do probability estimates
Definition at line 158 of file otbLibSVMMachineLearningModel.h.
|
virtual |
Container to hold the SVM model itself
|
virtual |
Container to hold the SVM model itself
|
overridevirtual |
Train the machine learning model
Implements otb::MachineLearningModel< TInputValue, TTargetValue >.
Definition at line 81 of file otbLibSVMMachineLearningModel.hxx.
|
private |
Number of steps for the coarse search
Definition at line 322 of file otbLibSVMMachineLearningModel.h.
|
private |
Output mode for confidence index (see enum )
Definition at line 328 of file otbLibSVMMachineLearningModel.h.
|
private |
Number of Cross Validation folders
Definition at line 313 of file otbLibSVMMachineLearningModel.h.
|
private |
Final cross validationa accuracy
Definition at line 319 of file otbLibSVMMachineLearningModel.h.
|
private |
Number of steps for the fine search
Definition at line 325 of file otbLibSVMMachineLearningModel.h.
|
private |
Initial cross validation accuracy
Definition at line 316 of file otbLibSVMMachineLearningModel.h.
|
private |
Container to hold the SVM model itself
Definition at line 301 of file otbLibSVMMachineLearningModel.h.
|
private |
Do parameters optimization, default : false
Definition at line 310 of file otbLibSVMMachineLearningModel.h.
|
private |
Container of the SVM parameters
Definition at line 307 of file otbLibSVMMachineLearningModel.h.
|
private |
Structure that stores training vectors
Definition at line 304 of file otbLibSVMMachineLearningModel.h.
|
private |
Temporary array to store cross-validation results
Definition at line 331 of file otbLibSVMMachineLearningModel.h.