OTB  9.0.0
Orfeo Toolbox
Public Types | List of all members
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue > Class Template Reference

#include <otbLibSVMMachineLearningModel.h>

+ Inheritance diagram for otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >:
+ Collaboration diagram for otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >:

Public Types

enum  ConfidenceMode {
  CM_INDEX,
  CM_PROBA,
  CM_HYPER
}
 
typedef Superclass::ConfidenceValueType ConfidenceValueType
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef Superclass::InputListSampleType InputListSampleType
 
typedef Superclass::InputSampleType InputSampleType
 
typedef Superclass::InputValueType InputValueType
 
typedef itk::SmartPointer< SelfPointer
 
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< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef MLMSampleTraits< TInputValue >::ValueType InputValueType
 
typedef MLMSampleTraits< TInputValue >::SampleType InputSampleType
 
typedef itk::Statistics::ListSample< InputSampleTypeInputListSampleType
 
typedef MLMTargetTraits< TTargetValue >::ValueType TargetValueType
 
typedef MLMTargetTraits< TTargetValue >::SampleType TargetSampleType
 
typedef itk::Statistics::ListSample< TargetSampleTypeTargetListSampleType
 
typedef MLMTargetTraits< double >::ValueType ConfidenceValueType
 
typedef MLMTargetTraits< double >::SampleType ConfidenceSampleType
 
typedef itk::Statistics::ListSample< ConfidenceSampleTypeConfidenceListSampleType
 
typedef itk::VariableLengthVector< double > ProbaSampleType
 
typedef itk::Statistics::ListSample< ProbaSampleTypeProbaListSampleType
 
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)
 

Additional Inherited Members

- Public Member Functions inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
virtual const char * GetNameOfClass () const
 
TargetSampleType Predict (const InputSampleType &input, ConfidenceValueType *quality=nullptr, ProbaSampleType *proba=nullptr) const
 
virtual void SetDimension (unsigned int _arg)
 
virtual unsigned int GetDimension ()
 
TargetListSampleType::Pointer PredictBatch (const InputListSampleType *input, ConfidenceListSampleType *quality=nullptr, ProbaListSampleType *proba=nullptr) const
 
bool HasConfidenceIndex () const
 
bool HasProbaIndex () const
 
virtual void SetInputListSample (InputListSampleType *_arg)
 
 itkGetObjectMacro (InputListSample, InputListSampleType)
 
virtual const InputListSampleTypeGetInputListSample () const
 
 itkGetObjectMacro (TargetListSample, TargetListSampleType)
 
 itkGetObjectMacro (ConfidenceListSample, ConfidenceListSampleType)
 
virtual void SetTargetListSample (TargetListSampleType *_arg)
 
virtual bool GetRegressionMode ()
 
void SetRegressionMode (bool flag)
 
- Protected Member Functions inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
 MachineLearningModel ()
 
 ~MachineLearningModel () override=default
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
- Protected Attributes inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
InputListSampleType::Pointer m_InputListSample
 
InputListSampleType::Pointer m_ValidationListSample
 
TargetListSampleType::Pointer m_TargetListSample
 
ConfidenceListSampleType::Pointer m_ConfidenceListSample
 
bool m_RegressionMode
 
bool m_IsRegressionSupported
 
bool m_ConfidenceIndex
 
bool m_ProbaIndex
 
bool m_IsDoPredictBatchMultiThreaded
 
unsigned int m_Dimension
 

Detailed Description

template<class TInputValue, class TTargetValue>
class otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >

Definition at line 33 of file otbLibSVMMachineLearningModel.h.

Member Typedef Documentation

◆ ConfidenceValueType

template<class TInputValue , class TTargetValue >
typedef Superclass::ConfidenceValueType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::ConfidenceValueType

Definition at line 48 of file otbLibSVMMachineLearningModel.h.

◆ ConstPointer

template<class TInputValue , class TTargetValue >
typedef itk::SmartPointer<const Self> otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::ConstPointer

Definition at line 40 of file otbLibSVMMachineLearningModel.h.

◆ InputListSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::InputListSampleType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::InputListSampleType

Definition at line 44 of file otbLibSVMMachineLearningModel.h.

◆ InputSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::InputSampleType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::InputSampleType

Definition at line 43 of file otbLibSVMMachineLearningModel.h.

◆ InputValueType

template<class TInputValue , class TTargetValue >
typedef Superclass::InputValueType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::InputValueType

Definition at line 42 of file otbLibSVMMachineLearningModel.h.

◆ Pointer

template<class TInputValue , class TTargetValue >
typedef itk::SmartPointer<Self> otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::Pointer

Definition at line 39 of file otbLibSVMMachineLearningModel.h.

◆ ProbaSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::ProbaSampleType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::ProbaSampleType

Definition at line 49 of file otbLibSVMMachineLearningModel.h.

◆ Self

template<class TInputValue , class TTargetValue >
typedef LibSVMMachineLearningModel otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::Self

Standard class typedefs.

Definition at line 37 of file otbLibSVMMachineLearningModel.h.

◆ Superclass

template<class TInputValue , class TTargetValue >
typedef MachineLearningModel<TInputValue, TTargetValue> otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::Superclass

Definition at line 38 of file otbLibSVMMachineLearningModel.h.

◆ TargetListSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::TargetListSampleType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::TargetListSampleType

Definition at line 47 of file otbLibSVMMachineLearningModel.h.

◆ TargetSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::TargetSampleType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::TargetSampleType

Definition at line 46 of file otbLibSVMMachineLearningModel.h.

◆ TargetValueType

template<class TInputValue , class TTargetValue >
typedef Superclass::TargetValueType otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::TargetValueType

Definition at line 45 of file otbLibSVMMachineLearningModel.h.

Member Enumeration Documentation

◆ ConfidenceMode

template<class TInputValue , class TTargetValue >
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.

Constructor & Destructor Documentation

◆ LibSVMMachineLearningModel() [1/2]

template<class TInputValue , class TOutputValue >
otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::LibSVMMachineLearningModel
protected

Constructor

Definition at line 35 of file otbLibSVMMachineLearningModel.hxx.

References otb::Utils::PrintNothing().

◆ ~LibSVMMachineLearningModel()

template<class TInputValue , class TOutputValue >
otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::~LibSVMMachineLearningModel
overrideprotected

Destructor

Definition at line 73 of file otbLibSVMMachineLearningModel.hxx.

◆ LibSVMMachineLearningModel() [2/2]

template<class TInputValue , class TTargetValue >
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::LibSVMMachineLearningModel ( const Self )
privatedelete

Container to hold the SVM model itself

Member Function Documentation

◆ BuildProblem()

template<class TInputValue , class TOutputValue >
void otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::BuildProblem ( void  )
private

Container to hold the SVM model itself

Definition at line 285 of file otbLibSVMMachineLearningModel.hxx.

References otbMsgDebugMacro.

◆ CanReadFile()

template<class TInputValue , class TOutputValue >
bool otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::CanReadFile ( const std::string &  file)
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.

◆ CanWriteFile()

template<class TInputValue , class TOutputValue >
bool otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::CanWriteFile ( const std::string &  )
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.

◆ ConsistencyCheck()

template<class TInputValue , class TOutputValue >
void otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::ConsistencyCheck ( void  )
private

Container to hold the SVM model itself

Definition at line 345 of file otbLibSVMMachineLearningModel.hxx.

References otbMsgDebugMacro.

◆ CreateAnother()

template<class TInputValue , class TTargetValue >
virtual::itk::LightObject::Pointer otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::CreateAnother ( void  ) const

Run-time type information (and related methods).

◆ CrossValidation()

template<class TInputValue , class TOutputValue >
double otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::CrossValidation ( void  )

Container to hold the SVM model itself

Definition at line 426 of file otbLibSVMMachineLearningModel.hxx.

◆ DeleteModel()

template<class TInputValue , class TOutputValue >
void otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::DeleteModel ( void  )
private

Container to hold the SVM model itself

Definition at line 386 of file otbLibSVMMachineLearningModel.hxx.

◆ DeleteProblem()

template<class TInputValue , class TOutputValue >
void otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::DeleteProblem ( void  )
private

Container to hold the SVM model itself

Definition at line 363 of file otbLibSVMMachineLearningModel.hxx.

◆ DoPredict()

template<class TInputValue , class TOutputValue >
LibSVMMachineLearningModel< TInputValue, TOutputValue >::TargetSampleType otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::DoPredict ( const InputSampleType input,
ConfidenceValueType quality = nullptr,
ProbaSampleType proba = nullptr 
) const
overrideprotected

Predict values using the model

Definition at line 104 of file otbLibSVMMachineLearningModel.hxx.

◆ DoShrinking()

template<class TInputValue , class TTargetValue >
void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::DoShrinking ( bool  s)
inline

Use the shrinking heuristics for the training

Definition at line 202 of file otbLibSVMMachineLearningModel.h.

◆ GetC()

template<class TInputValue , class TTargetValue >
double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetC ( void  ) const
inline

Get the C parameter for the training for C_SVC, EPSILON_SVR and NU_SVR

Definition at line 149 of file otbLibSVMMachineLearningModel.h.

◆ GetCacheSize()

template<class TInputValue , class TTargetValue >
int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetCacheSize ( void  ) const
inline

Get the cache size in MB for the training

Definition at line 224 of file otbLibSVMMachineLearningModel.h.

◆ GetCoarseOptimizationNumberOfSteps()

template<class TInputValue , class TTargetValue >
virtual unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetCoarseOptimizationNumberOfSteps ( )
virtual

Container to hold the SVM model itself

◆ GetConfidenceMode()

template<class TInputValue , class TTargetValue >
virtual unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetConfidenceMode ( )
virtual

Container to hold the SVM model itself

◆ GetCVFolders()

template<class TInputValue , class TTargetValue >
virtual unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetCVFolders ( )
virtual

Container to hold the SVM model itself

◆ GetDoProbabilityEstimates()

template<class TInputValue , class TTargetValue >
bool otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetDoProbabilityEstimates ( void  ) const
inline

Get Do probability estimates boolean

Definition at line 164 of file otbLibSVMMachineLearningModel.h.

◆ GetDoShrinking()

template<class TInputValue , class TTargetValue >
bool otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetDoShrinking ( void  ) const
inline

Get Use the shrinking heuristics for the training boolea

Definition at line 210 of file otbLibSVMMachineLearningModel.h.

◆ GetEpsilon()

template<class TInputValue , class TTargetValue >
double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetEpsilon ( void  ) const
inline

Get the tolerance for the stopping criterion for the training

Definition at line 176 of file otbLibSVMMachineLearningModel.h.

◆ GetFinalCrossValidationAccuracy()

template<class TInputValue , class TTargetValue >
virtual double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetFinalCrossValidationAccuracy ( )
virtual

Container to hold the SVM model itself

◆ GetFineOptimizationNumberOfSteps()

template<class TInputValue , class TTargetValue >
virtual unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetFineOptimizationNumberOfSteps ( )
virtual

Container to hold the SVM model itself

◆ GetInitialCrossValidationAccuracy()

template<class TInputValue , class TTargetValue >
virtual double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetInitialCrossValidationAccuracy ( )
virtual

Container to hold the SVM model itself

◆ GetKernelCoef0()

template<class TInputValue , class TTargetValue >
double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetKernelCoef0 ( void  ) const
inline

Get the coef0 parameter for poly/sigmoid kernels

Definition at line 140 of file otbLibSVMMachineLearningModel.h.

◆ GetKernelGamma()

template<class TInputValue , class TTargetValue >
double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetKernelGamma ( void  ) const
inline

Get the gamma parameter for poly/rbf/sigmoid kernels

Definition at line 131 of file otbLibSVMMachineLearningModel.h.

◆ GetKernelType()

template<class TInputValue , class TTargetValue >
int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetKernelType ( void  ) const
inline

Get the kernel type

Definition at line 113 of file otbLibSVMMachineLearningModel.h.

◆ GetNameOfClass()

template<class TInputValue , class TTargetValue >
virtual const char* otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

◆ GetNu()

template<class TInputValue , class TTargetValue >
double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetNu ( void  ) const
inline

Set the Nu parameter for the training

Definition at line 194 of file otbLibSVMMachineLearningModel.h.

◆ GetNumberOfClasses()

template<class TInputValue , class TTargetValue >
unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetNumberOfClasses ( void  ) const
inline

Container to hold the SVM model itself

Definition at line 266 of file otbLibSVMMachineLearningModel.h.

◆ GetNumberOfKernelParameters()

template<class TInputValue , class TOutputValue >
unsigned int otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::GetNumberOfKernelParameters

Container to hold the SVM model itself

Definition at line 396 of file otbLibSVMMachineLearningModel.hxx.

◆ GetNumberOfSupportVectors()

template<class TInputValue , class TTargetValue >
unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetNumberOfSupportVectors ( void  ) const
inline

Return number of support vectors

Definition at line 258 of file otbLibSVMMachineLearningModel.h.

◆ GetP()

template<class TInputValue , class TTargetValue >
double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetP ( void  ) const
inline

Get the value of p for EPSILON_SVR

Definition at line 185 of file otbLibSVMMachineLearningModel.h.

◆ GetParameterOptimization()

template<class TInputValue , class TTargetValue >
virtual bool otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetParameterOptimization ( )
virtual

Container to hold the SVM model itself

◆ GetPolynomialKernelDegree()

template<class TInputValue , class TTargetValue >
int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetPolynomialKernelDegree ( void  ) const
inline

Get the degree of the polynomial kernel

Definition at line 122 of file otbLibSVMMachineLearningModel.h.

◆ GetSVMType()

template<class TInputValue , class TTargetValue >
int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetSVMType ( void  ) const
inline

Get the SVM type (C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR)

Definition at line 100 of file otbLibSVMMachineLearningModel.h.

◆ HasProbabilities()

template<class TInputValue , class TOutputValue >
bool otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::HasProbabilities ( void  ) const

Test if the model has probabilities

Definition at line 267 of file otbLibSVMMachineLearningModel.hxx.

◆ Load()

template<class TInputValue , class TOutputValue >
void otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::Load ( const std::string &  filename,
const std::string &  name = "" 
)
overridevirtual

Load the model from file

Implements otb::MachineLearningModel< TInputValue, TTargetValue >.

Definition at line 213 of file otbLibSVMMachineLearningModel.hxx.

◆ New()

template<class TInputValue , class TTargetValue >
static Pointer otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::New ( )
static

Run-time type information (and related methods).

◆ operator=()

template<class TInputValue , class TTargetValue >
void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::operator= ( const Self )
privatedelete

Container to hold the SVM model itself

◆ OptimizeParameters()

template<class TInputValue , class TOutputValue >
void otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::OptimizeParameters ( void  )
private

Container to hold the SVM model itself

Definition at line 453 of file otbLibSVMMachineLearningModel.hxx.

References otb::ExhaustiveExponentialOptimizer::New(), otbMsgDebugMacro, and otbMsgDevMacro.

◆ otbSetSVMParameterMacro() [1/9]

template<class TInputValue , class TTargetValue >
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro ( ,
,
double   
)

Set the C parameter for the training for C_SVC, EPSILON_SVR and C_SVR

◆ otbSetSVMParameterMacro() [2/9]

template<class TInputValue , class TTargetValue >
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro ( Epsilon  ,
eps  ,
double   
)

Set the tolerance for the stopping criterion for the training

◆ otbSetSVMParameterMacro() [3/9]

template<class TInputValue , class TTargetValue >
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro ( KernelCoef0  ,
coef0  ,
double   
)

Set the coef0 parameter for poly/sigmoid kernels

◆ otbSetSVMParameterMacro() [4/9]

template<class TInputValue , class TTargetValue >
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro ( KernelGamma  ,
gamma  ,
double   
)

Set the gamma parameter for poly/rbf/sigmoid kernels

◆ otbSetSVMParameterMacro() [5/9]

template<class TInputValue , class TTargetValue >
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)

◆ otbSetSVMParameterMacro() [6/9]

template<class TInputValue , class TTargetValue >
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro ( Nu  ,
nu  ,
double   
)

Set the Nu parameter for the training

◆ otbSetSVMParameterMacro() [7/9]

template<class TInputValue , class TTargetValue >
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro ( ,
,
double   
)

Set the value of p for EPSILON_SVR

◆ otbSetSVMParameterMacro() [8/9]

template<class TInputValue , class TTargetValue >
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro ( PolynomialKernelDegree  ,
degree  ,
int   
)

Set the degree of the polynomial kernel

◆ otbSetSVMParameterMacro() [9/9]

template<class TInputValue , class TTargetValue >
otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::otbSetSVMParameterMacro ( SVMType  ,
svm_type  ,
int   
)

Set the SVM type to C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR

◆ PrintSelf()

template<class TInputValue , class TOutputValue >
void otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

PrintSelf method

Definition at line 260 of file otbLibSVMMachineLearningModel.hxx.

◆ Save()

template<class TInputValue , class TOutputValue >
void otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::Save ( const std::string &  filename,
const std::string &  name = "" 
)
overridevirtual

Save the model to file

Implements otb::MachineLearningModel< TInputValue, TTargetValue >.

Definition at line 204 of file otbLibSVMMachineLearningModel.hxx.

◆ SetCacheSize()

template<class TInputValue , class TTargetValue >
void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::SetCacheSize ( int  cSize)
inline

Set the cache size in MB for the training

Definition at line 216 of file otbLibSVMMachineLearningModel.h.

◆ SetCoarseOptimizationNumberOfSteps()

template<class TInputValue , class TTargetValue >
virtual void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::SetCoarseOptimizationNumberOfSteps ( unsigned int  _arg)
virtual

Container to hold the SVM model itself

◆ SetConfidenceMode()

template<class TInputValue , class TTargetValue >
void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::SetConfidenceMode ( unsigned int  mode)
inline

Container to hold the SVM model itself

Definition at line 242 of file otbLibSVMMachineLearningModel.h.

◆ SetCVFolders()

template<class TInputValue , class TTargetValue >
virtual void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::SetCVFolders ( unsigned int  _arg)
virtual

Container to hold the SVM model itself

◆ SetDoProbabilityEstimates()

template<class TInputValue , class TTargetValue >
void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::SetDoProbabilityEstimates ( bool  prob)
inline

Do probability estimates

Definition at line 158 of file otbLibSVMMachineLearningModel.h.

◆ SetFineOptimizationNumberOfSteps()

template<class TInputValue , class TTargetValue >
virtual void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::SetFineOptimizationNumberOfSteps ( unsigned int  _arg)
virtual

Container to hold the SVM model itself

◆ SetParameterOptimization()

template<class TInputValue , class TTargetValue >
virtual void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::SetParameterOptimization ( bool  _arg)
virtual

Container to hold the SVM model itself

◆ Train()

template<class TInputValue , class TOutputValue >
void otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::Train
overridevirtual

Train the machine learning model

Implements otb::MachineLearningModel< TInputValue, TTargetValue >.

Definition at line 81 of file otbLibSVMMachineLearningModel.hxx.

Member Data Documentation

◆ m_CoarseOptimizationNumberOfSteps

template<class TInputValue , class TTargetValue >
unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_CoarseOptimizationNumberOfSteps
private

Number of steps for the coarse search

Definition at line 322 of file otbLibSVMMachineLearningModel.h.

◆ m_ConfidenceMode

template<class TInputValue , class TTargetValue >
ConfidenceMode otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_ConfidenceMode
private

Output mode for confidence index (see enum )

Definition at line 328 of file otbLibSVMMachineLearningModel.h.

◆ m_CVFolders

template<class TInputValue , class TTargetValue >
unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_CVFolders
private

Number of Cross Validation folders

Definition at line 313 of file otbLibSVMMachineLearningModel.h.

◆ m_FinalCrossValidationAccuracy

template<class TInputValue , class TTargetValue >
double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_FinalCrossValidationAccuracy
private

Final cross validationa accuracy

Definition at line 319 of file otbLibSVMMachineLearningModel.h.

◆ m_FineOptimizationNumberOfSteps

template<class TInputValue , class TTargetValue >
unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_FineOptimizationNumberOfSteps
private

Number of steps for the fine search

Definition at line 325 of file otbLibSVMMachineLearningModel.h.

◆ m_InitialCrossValidationAccuracy

template<class TInputValue , class TTargetValue >
double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_InitialCrossValidationAccuracy
private

Initial cross validation accuracy

Definition at line 316 of file otbLibSVMMachineLearningModel.h.

◆ m_Model

template<class TInputValue , class TTargetValue >
struct svm_model* otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_Model
private

Container to hold the SVM model itself

Definition at line 301 of file otbLibSVMMachineLearningModel.h.

◆ m_ParameterOptimization

template<class TInputValue , class TTargetValue >
bool otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_ParameterOptimization
private

Do parameters optimization, default : false

Definition at line 310 of file otbLibSVMMachineLearningModel.h.

◆ m_Parameters

template<class TInputValue , class TTargetValue >
struct svm_parameter otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_Parameters
private

Container of the SVM parameters

Definition at line 307 of file otbLibSVMMachineLearningModel.h.

◆ m_Problem

template<class TInputValue , class TTargetValue >
struct svm_problem otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_Problem
private

Structure that stores training vectors

Definition at line 304 of file otbLibSVMMachineLearningModel.h.

◆ m_TmpTarget

template<class TInputValue , class TTargetValue >
std::vector<double> otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::m_TmpTarget
private

Temporary array to store cross-validation results

Definition at line 331 of file otbLibSVMMachineLearningModel.h.


The documentation for this class was generated from the following files: