OTB  6.7.0
Orfeo Toolbox
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | 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 Self
ConstPointer
 
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 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
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

double GetC (void) const
 
int GetCacheSize (void) const
 
virtual unsigned int GetCoarseOptimizationNumberOfSteps ()
 
virtual unsigned int GetConfidenceMode ()
 
virtual unsigned int GetCVFolders ()
 
bool GetDoProbabilityEstimates (void) const
 
bool GetDoShrinking (void) const
 
double GetEpsilon (void) const
 
virtual double GetFinalCrossValidationAccuracy ()
 
virtual unsigned int GetFineOptimizationNumberOfSteps ()
 
virtual double GetInitialCrossValidationAccuracy ()
 
double GetKernelCoef0 (void) const
 
double GetKernelGamma (void) const
 
int GetKernelType (void) const
 
double GetNu (void) const
 
unsigned int GetNumberOfClasses (void) const
 
double GetP (void) const
 
virtual bool GetParameterOptimization ()
 
int GetPolynomialKernelDegree (void) const
 
int GetSVMType (void) const
 
 otbSetSVMParameterMacro (SVMType, svm_type, int)
 
 otbSetSVMParameterMacro (KernelType, kernel_type, int)
 
 otbSetSVMParameterMacro (PolynomialKernelDegree, degree, int)
 
 otbSetSVMParameterMacro (KernelGamma, gamma, double)
 
 otbSetSVMParameterMacro (KernelCoef0, coef0, double)
 
 otbSetSVMParameterMacro (C, C, double)
 
 otbSetSVMParameterMacro (Epsilon, eps, double)
 
 otbSetSVMParameterMacro (P, p, double)
 
 otbSetSVMParameterMacro (Nu, nu, double)
 
virtual void SetCoarseOptimizationNumberOfSteps (unsigned int _arg)
 
void SetConfidenceMode (unsigned int mode)
 
virtual void SetCVFolders (unsigned int _arg)
 
void SetDoProbabilityEstimates (bool prob)
 
virtual void SetFineOptimizationNumberOfSteps (unsigned int _arg)
 
virtual void SetParameterOptimization (bool _arg)
 
Classification model file compatibility tests
bool CanReadFile (const std::string &) override
 
bool CanWriteFile (const std::string &) override
 
void DoShrinking (bool s)
 
void SetCacheSize (int cSize)
 
unsigned int GetNumberOfSupportVectors (void) const
 
- Public Member Functions inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
bool HasConfidenceIndex () const
 
bool HasProbaIndex () const
 
 itkGetObjectMacro (ConfidenceListSample, ConfidenceListSampleType)
 
TargetSampleType Predict (const InputSampleType &input, ConfidenceValueType *quality=nullptr, ProbaSampleType *proba=nullptr) const
 
TargetListSampleType::Pointer PredictBatch (const InputListSampleType *input, ConfidenceListSampleType *quality=nullptr, ProbaListSampleType *proba=nullptr) const
 
virtual void SetDimension (unsigned int _arg)
 
virtual unsigned int GetDimension ()
 
virtual void SetInputListSample (InputListSampleType *_arg)
 
 itkGetObjectMacro (InputListSample, InputListSampleType)
 
virtual const InputListSampleTypeGetInputListSample () const
 
 itkGetObjectMacro (TargetListSample, TargetListSampleType)
 
virtual void SetTargetListSample (TargetListSampleType *_arg)
 
virtual bool GetRegressionMode ()
 
void SetRegressionMode (bool flag)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
virtual ModifiedTimeType GetMTime () const
 
virtual const std::string & GetObjectName () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Protected Member Functions

 LibSVMMachineLearningModel ()
 
 ~LibSVMMachineLearningModel () override
 
- Protected Member Functions inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
 MachineLearningModel ()
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 ~MachineLearningModel () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Member Functions

 LibSVMMachineLearningModel (const Self &)=delete
 
void operator= (const Self &)=delete
 

Private Attributes

unsigned int m_CoarseOptimizationNumberOfSteps
 
ConfidenceMode m_ConfidenceMode
 
unsigned int m_CVFolders
 
double m_FinalCrossValidationAccuracy
 
unsigned int m_FineOptimizationNumberOfSteps
 
double m_InitialCrossValidationAccuracy
 
struct svm_model * m_Model
 
bool m_ParameterOptimization
 
struct svm_parameter m_Parameters
 
struct svm_problem m_Problem
 
std::vector< double > m_TmpTarget
 
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
 
bool HasProbabilities (void) const
 
unsigned int GetNumberOfKernelParameters ()
 
double CrossValidation (void)
 
TargetSampleType DoPredict (const InputSampleType &input, ConfidenceValueType *quality=nullptr, ProbaSampleType *proba=nullptr) const override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
void BuildProblem (void)
 
void ConsistencyCheck (void)
 
void DeleteProblem (void)
 
void DeleteModel (void)
 
void OptimizeParameters (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 
- Protected Attributes inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
bool m_ConfidenceIndex
 
ConfidenceListSampleType::Pointer m_ConfidenceListSample
 
unsigned int m_Dimension
 
InputListSampleType::Pointer m_InputListSample
 
bool m_IsDoPredictBatchMultiThreaded
 
bool m_IsRegressionSupported
 
bool m_ProbaIndex
 
bool m_RegressionMode
 
TargetListSampleType::Pointer m_TargetListSample
 
InputListSampleType::Pointer m_ValidationListSample
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Detailed Description

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

Definition at line 33 of file otbLibSVMMachineLearningModel.h.

Member Typedef Documentation

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

Definition at line 49 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 41 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 45 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 44 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 43 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 40 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 50 of file otbLibSVMMachineLearningModel.h.

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

Standard class typedefs.

Definition at line 38 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 39 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 48 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 47 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 46 of file otbLibSVMMachineLearningModel.h.

Member Enumeration Documentation

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 60 of file otbLibSVMMachineLearningModel.h.

Constructor & Destructor Documentation

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

Constructor

Definition at line 36 of file otbLibSVMMachineLearningModel.hxx.

References otb::Utils::PrintNothing().

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

Destructor

Definition at line 76 of file otbLibSVMMachineLearningModel.hxx.

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

Member Function Documentation

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

Train the machine learning model

Definition at line 307 of file otbLibSVMMachineLearningModel.hxx.

References otbMsgDebugMacro.

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 240 of file otbLibSVMMachineLearningModel.hxx.

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 269 of file otbLibSVMMachineLearningModel.hxx.

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

Train the machine learning model

Definition at line 369 of file otbLibSVMMachineLearningModel.hxx.

References otbMsgDebugMacro.

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

Run-time type information (and related methods).

Reimplemented from itk::Object.

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

Train the machine learning model

Definition at line 458 of file otbLibSVMMachineLearningModel.hxx.

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

Train the machine learning model

Definition at line 414 of file otbLibSVMMachineLearningModel.hxx.

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

Train the machine learning model

Definition at line 389 of file otbLibSVMMachineLearningModel.hxx.

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 111 of file otbLibSVMMachineLearningModel.hxx.

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

Use the shrinking heuristics for the training

Definition at line 203 of file otbLibSVMMachineLearningModel.h.

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 150 of file otbLibSVMMachineLearningModel.h.

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 225 of file otbLibSVMMachineLearningModel.h.

template<class TInputValue, class TTargetValue>
virtual unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetCoarseOptimizationNumberOfSteps ( )
virtual
template<class TInputValue, class TTargetValue>
virtual unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetConfidenceMode ( )
virtual
template<class TInputValue, class TTargetValue>
virtual unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetCVFolders ( )
virtual
template<class TInputValue, class TTargetValue>
bool otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetDoProbabilityEstimates ( void  ) const
inline

Get Do probability estimates boolean

Definition at line 165 of file otbLibSVMMachineLearningModel.h.

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 211 of file otbLibSVMMachineLearningModel.h.

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 177 of file otbLibSVMMachineLearningModel.h.

template<class TInputValue, class TTargetValue>
virtual double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetFinalCrossValidationAccuracy ( )
virtual
template<class TInputValue, class TTargetValue>
virtual unsigned int otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetFineOptimizationNumberOfSteps ( )
virtual
template<class TInputValue, class TTargetValue>
virtual double otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::GetInitialCrossValidationAccuracy ( )
virtual
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 141 of file otbLibSVMMachineLearningModel.h.

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 132 of file otbLibSVMMachineLearningModel.h.

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

Get the kernel type

Definition at line 114 of file otbLibSVMMachineLearningModel.h.

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

Run-time type information (and related methods).

Reimplemented from otb::MachineLearningModel< TInputValue, TTargetValue >.

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

Set the Nu parameter for the training

Definition at line 195 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 266 of file otbLibSVMMachineLearningModel.h.

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

Train the machine learning model

Definition at line 426 of file otbLibSVMMachineLearningModel.hxx.

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

Return number of support vectors

Definition at line 259 of file otbLibSVMMachineLearningModel.h.

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 186 of file otbLibSVMMachineLearningModel.h.

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

Get the degree of the polynomial kernel

Definition at line 123 of file otbLibSVMMachineLearningModel.h.

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 101 of file otbLibSVMMachineLearningModel.h.

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

Test if the model has probabilities

Definition at line 286 of file otbLibSVMMachineLearningModel.hxx.

References type.

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 224 of file otbLibSVMMachineLearningModel.hxx.

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

Run-time type information (and related methods).

template<class TInputValue, class TTargetValue>
void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::operator= ( const Self )
privatedelete
template<class TInputValue , class TOutputValue >
void otb::LibSVMMachineLearningModel< TInputValue, TOutputValue >::OptimizeParameters ( void  )
private
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

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)

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

Set the degree of the polynomial kernel

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

Set the gamma parameter for poly/rbf/sigmoid kernels

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

Set the coef0 parameter for poly/sigmoid kernels

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

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

Set the tolerance for the stopping criterion for the training

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

Set the value of p for EPSILON_SVR

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

Set the Nu parameter for the training

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

PrintSelf method

Reimplemented from itk::Object.

Definition at line 277 of file otbLibSVMMachineLearningModel.hxx.

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 213 of file otbLibSVMMachineLearningModel.hxx.

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 217 of file otbLibSVMMachineLearningModel.h.

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

Definition at line 243 of file otbLibSVMMachineLearningModel.h.

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

Do probability estimates

Definition at line 159 of file otbLibSVMMachineLearningModel.h.

template<class TInputValue, class TTargetValue>
virtual void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::SetFineOptimizationNumberOfSteps ( unsigned int  _arg)
virtual
template<class TInputValue, class TTargetValue>
virtual void otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::SetParameterOptimization ( bool  _arg)
virtual
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 86 of file otbLibSVMMachineLearningModel.hxx.

Member Data Documentation

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

Number of steps for the coarse search

Definition at line 321 of file otbLibSVMMachineLearningModel.h.

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

Output mode for confidence index (see enum )

Definition at line 327 of file otbLibSVMMachineLearningModel.h.

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

Number of Cross Validation folders

Definition at line 312 of file otbLibSVMMachineLearningModel.h.

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

Final cross validationa accuracy

Definition at line 318 of file otbLibSVMMachineLearningModel.h.

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

Number of steps for the fine search

Definition at line 324 of file otbLibSVMMachineLearningModel.h.

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

Initial cross validation accuracy

Definition at line 315 of file otbLibSVMMachineLearningModel.h.

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 300 of file otbLibSVMMachineLearningModel.h.

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

Do parameters optimization, default : false

Definition at line 309 of file otbLibSVMMachineLearningModel.h.

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

Container of the SVM parameters

Definition at line 306 of file otbLibSVMMachineLearningModel.h.

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

Structure that stores training vectors

Definition at line 303 of file otbLibSVMMachineLearningModel.h.

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 330 of file otbLibSVMMachineLearningModel.h.


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