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

#include <otbBoostMachineLearningModel.h>

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

Public Types

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 BoostMachineLearningModel 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
 
virtual int GetBoostType ()
 
virtual void SetBoostType (int _arg)
 
virtual int GetWeakCount ()
 
virtual void SetWeakCount (int _arg)
 
virtual double GetWeightTrimRate ()
 
virtual void SetWeightTrimRate (double _arg)
 
virtual int GetMaxDepth ()
 
virtual void SetMaxDepth (int _arg)
 
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

cv::Ptr< cv::ml::Boost > m_BoostModel
 
int m_BoostType
 
int m_WeakCount
 
double m_WeightTrimRate
 
int m_MaxDepth
 
bool CanReadFile (const std::string &) override
 
bool CanWriteFile (const std::string &) override
 
 BoostMachineLearningModel ()
 
 ~BoostMachineLearningModel () override=default
 
TargetSampleType DoPredict (const InputSampleType &input, ConfidenceValueType *quality=nullptr, ProbaSampleType *proba=nullptr) const override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 BoostMachineLearningModel (const Self &)=delete
 
void operator= (const Self &)=delete
 

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::BoostMachineLearningModel< TInputValue, TTargetValue >

Definition at line 35 of file otbBoostMachineLearningModel.h.

Member Typedef Documentation

◆ ConfidenceValueType

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

Definition at line 50 of file otbBoostMachineLearningModel.h.

◆ ConstPointer

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

Definition at line 42 of file otbBoostMachineLearningModel.h.

◆ InputListSampleType

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

Definition at line 46 of file otbBoostMachineLearningModel.h.

◆ InputSampleType

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

Definition at line 45 of file otbBoostMachineLearningModel.h.

◆ InputValueType

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

Definition at line 44 of file otbBoostMachineLearningModel.h.

◆ Pointer

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

Definition at line 41 of file otbBoostMachineLearningModel.h.

◆ ProbaSampleType

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

Definition at line 51 of file otbBoostMachineLearningModel.h.

◆ Self

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

Standard class typedefs.

Definition at line 39 of file otbBoostMachineLearningModel.h.

◆ Superclass

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

Definition at line 40 of file otbBoostMachineLearningModel.h.

◆ TargetListSampleType

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

Definition at line 49 of file otbBoostMachineLearningModel.h.

◆ TargetSampleType

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

Definition at line 48 of file otbBoostMachineLearningModel.h.

◆ TargetValueType

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

Definition at line 47 of file otbBoostMachineLearningModel.h.

Constructor & Destructor Documentation

◆ BoostMachineLearningModel() [1/2]

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

◆ ~BoostMachineLearningModel()

template<class TInputValue , class TTargetValue >
otb::BoostMachineLearningModel< TInputValue, TTargetValue >::~BoostMachineLearningModel ( )
overrideprotecteddefault

Destructor

◆ BoostMachineLearningModel() [2/2]

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

Is the input model file readable and compatible with the corresponding classifier ?

Member Function Documentation

◆ CanReadFile()

template<class TInputValue , class TOutputValue >
bool otb::BoostMachineLearningModel< 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 112 of file otbBoostMachineLearningModel.hxx.

References CV_TYPE_NAME_ML_BOOSTING.

◆ CanWriteFile()

template<class TInputValue , class TOutputValue >
bool otb::BoostMachineLearningModel< 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 140 of file otbBoostMachineLearningModel.hxx.

◆ CreateAnother()

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

Run-time type information (and related methods).

◆ DoPredict()

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

Predict values using the model

Definition at line 71 of file otbBoostMachineLearningModel.hxx.

◆ GetBoostType()

template<class TInputValue , class TTargetValue >
virtual int otb::BoostMachineLearningModel< TInputValue, TTargetValue >::GetBoostType ( )
virtual

Setters/Getters to the Boost type It can be CvBoost::DISCRETE, CvBoost::REAL, CvBoost::LOGIT, CvBoost::GENTLE Default is CvBoost::REAL.

See also
http://docs.opencv.org/modules/ml/doc/boosting.html#cvboostparams-cvboostparams

◆ GetMaxDepth()

template<class TInputValue , class TTargetValue >
virtual int otb::BoostMachineLearningModel< TInputValue, TTargetValue >::GetMaxDepth ( )
virtual

Setters/Getters to the maximum depth of the tree. Default is 1

See also
http://docs.opencv.org/modules/ml/doc/decision_trees.html#CvDTreeParams::CvDTreeParams%28%29

◆ GetNameOfClass()

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

Run-time type information (and related methods).

◆ GetWeakCount()

template<class TInputValue , class TTargetValue >
virtual int otb::BoostMachineLearningModel< TInputValue, TTargetValue >::GetWeakCount ( )
virtual

Setters/Getters to the number of weak classifiers. Default is 100.

See also
http://docs.opencv.org/modules/ml/doc/boosting.html#cvboostparams-cvboostparams

◆ GetWeightTrimRate()

template<class TInputValue , class TTargetValue >
virtual double otb::BoostMachineLearningModel< TInputValue, TTargetValue >::GetWeightTrimRate ( )
virtual

Setters/Getters to the threshold WeightTrimRate. A threshold between 0 and 1 used to save computational time. Samples with summary weight $ w \leq 1 - WeightTrimRate $ do not participate in the next iteration of training. Set this parameter to 0 to turn off this functionality. Default is 0.95

See also
http://docs.opencv.org/modules/ml/doc/boosting.html#cvboostparams-cvboostparams

◆ Load()

template<class TInputValue , class TOutputValue >
void otb::BoostMachineLearningModel< 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 105 of file otbBoostMachineLearningModel.hxx.

◆ New()

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

Run-time type information (and related methods).

◆ operator=()

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

Is the input model file readable and compatible with the corresponding classifier ?

◆ PrintSelf()

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

PrintSelf method

Definition at line 146 of file otbBoostMachineLearningModel.hxx.

◆ Save()

template<class TInputValue , class TOutputValue >
void otb::BoostMachineLearningModel< 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 95 of file otbBoostMachineLearningModel.hxx.

◆ SetBoostType()

template<class TInputValue , class TTargetValue >
virtual void otb::BoostMachineLearningModel< TInputValue, TTargetValue >::SetBoostType ( int  _arg)
virtual

Run-time type information (and related methods).

◆ SetMaxDepth()

template<class TInputValue , class TTargetValue >
virtual void otb::BoostMachineLearningModel< TInputValue, TTargetValue >::SetMaxDepth ( int  _arg)
virtual

Run-time type information (and related methods).

◆ SetWeakCount()

template<class TInputValue , class TTargetValue >
virtual void otb::BoostMachineLearningModel< TInputValue, TTargetValue >::SetWeakCount ( int  _arg)
virtual

Run-time type information (and related methods).

◆ SetWeightTrimRate()

template<class TInputValue , class TTargetValue >
virtual void otb::BoostMachineLearningModel< TInputValue, TTargetValue >::SetWeightTrimRate ( double  _arg)
virtual

Run-time type information (and related methods).

◆ Train()

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

Train the machine learning model

Implements otb::MachineLearningModel< TInputValue, TTargetValue >.

Definition at line 46 of file otbBoostMachineLearningModel.hxx.

References CV_VAR_CATEGORICAL, and CV_VAR_NUMERICAL.

Member Data Documentation

◆ m_BoostModel

template<class TInputValue , class TTargetValue >
cv::Ptr<cv::ml::Boost> otb::BoostMachineLearningModel< TInputValue, TTargetValue >::m_BoostModel
private

Is the input model file readable and compatible with the corresponding classifier ?

Definition at line 129 of file otbBoostMachineLearningModel.h.

◆ m_BoostType

template<class TInputValue , class TTargetValue >
int otb::BoostMachineLearningModel< TInputValue, TTargetValue >::m_BoostType
private

Is the input model file readable and compatible with the corresponding classifier ?

Definition at line 131 of file otbBoostMachineLearningModel.h.

◆ m_MaxDepth

template<class TInputValue , class TTargetValue >
int otb::BoostMachineLearningModel< TInputValue, TTargetValue >::m_MaxDepth
private

Is the input model file readable and compatible with the corresponding classifier ?

Definition at line 134 of file otbBoostMachineLearningModel.h.

◆ m_WeakCount

template<class TInputValue , class TTargetValue >
int otb::BoostMachineLearningModel< TInputValue, TTargetValue >::m_WeakCount
private

Is the input model file readable and compatible with the corresponding classifier ?

Definition at line 132 of file otbBoostMachineLearningModel.h.

◆ m_WeightTrimRate

template<class TInputValue , class TTargetValue >
double otb::BoostMachineLearningModel< TInputValue, TTargetValue >::m_WeightTrimRate
private

Is the input model file readable and compatible with the corresponding classifier ?

Definition at line 133 of file otbBoostMachineLearningModel.h.


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