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

#include <otbRandomForestsMachineLearningModel.h>

+ Inheritance diagram for otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >:
+ Collaboration diagram for otb::RandomForestsMachineLearningModel< 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 CvRTreesWrapper RFType
 
typedef RandomForestsMachineLearningModel Self
 
typedef MachineLearningModel< TInputValue, TTargetValue > Superclass
 
typedef Superclass::TargetListSampleType TargetListSampleType
 
typedef Superclass::TargetSampleType TargetSampleType
 
typedef Superclass::TargetValueType TargetValueType
 
typedef itk::VariableSizeMatrix< float > VariableImportanceMatrixType
 
- 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

cv::Ptr< CvRTreesWrapperm_RFModel
 
int m_MaxDepth
 
int m_MinSampleCount
 
float m_RegressionAccuracy
 
bool m_ComputeSurrogateSplit
 
int m_MaxNumberOfCategories
 
std::vector< float > m_Priors
 
bool m_CalculateVariableImportance
 
int m_MaxNumberOfVariables
 
int m_MaxNumberOfTrees
 
float m_ForestAccuracy
 
int m_TerminationCriteria
 
bool m_ComputeMargin
 
bool CanReadFile (const std::string &) override
 
bool CanWriteFile (const std::string &) override
 
virtual int GetMaxDepth ()
 
virtual void SetMaxDepth (int _arg)
 
virtual int GetMinSampleCount ()
 
virtual void SetMinSampleCount (int _arg)
 
virtual double GetRegressionAccuracy ()
 
virtual void SetRegressionAccuracy (double _arg)
 
virtual bool GetComputeSurrogateSplit ()
 
virtual void SetComputeSurrogateSplit (bool _arg)
 
virtual int GetMaxNumberOfCategories ()
 
virtual void SetMaxNumberOfCategories (int _arg)
 
std::vector< float > GetPriors () const
 
void SetPriors (const std::vector< float > &priors)
 
virtual bool GetCalculateVariableImportance ()
 
virtual void SetCalculateVariableImportance (bool _arg)
 
virtual int GetMaxNumberOfVariables ()
 
virtual void SetMaxNumberOfVariables (int _arg)
 
virtual int GetMaxNumberOfTrees ()
 
virtual void SetMaxNumberOfTrees (int _arg)
 
virtual float GetForestAccuracy ()
 
virtual void SetForestAccuracy (float _arg)
 
virtual int GetTerminationCriteria ()
 
virtual void SetTerminationCriteria (int _arg)
 
virtual bool GetComputeMargin ()
 
virtual void SetComputeMargin (bool _arg)
 
VariableImportanceMatrixType GetVariableImportance ()
 
float GetTrainError ()
 
 RandomForestsMachineLearningModel ()
 
 ~RandomForestsMachineLearningModel () 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
 
 RandomForestsMachineLearningModel (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::RandomForestsMachineLearningModel< TInputValue, TTargetValue >

Definition at line 36 of file otbRandomForestsMachineLearningModel.h.

Member Typedef Documentation

◆ ConfidenceValueType

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

Definition at line 51 of file otbRandomForestsMachineLearningModel.h.

◆ ConstPointer

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

Definition at line 43 of file otbRandomForestsMachineLearningModel.h.

◆ InputListSampleType

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

Definition at line 47 of file otbRandomForestsMachineLearningModel.h.

◆ InputSampleType

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

Definition at line 46 of file otbRandomForestsMachineLearningModel.h.

◆ InputValueType

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

Definition at line 45 of file otbRandomForestsMachineLearningModel.h.

◆ Pointer

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

Definition at line 42 of file otbRandomForestsMachineLearningModel.h.

◆ ProbaSampleType

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

Definition at line 52 of file otbRandomForestsMachineLearningModel.h.

◆ RFType

template<class TInputValue , class TTargetValue >
typedef CvRTreesWrapper otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::RFType

Definition at line 58 of file otbRandomForestsMachineLearningModel.h.

◆ Self

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

Standard class typedefs.

Definition at line 40 of file otbRandomForestsMachineLearningModel.h.

◆ Superclass

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

Definition at line 41 of file otbRandomForestsMachineLearningModel.h.

◆ TargetListSampleType

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

Definition at line 50 of file otbRandomForestsMachineLearningModel.h.

◆ TargetSampleType

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

Definition at line 49 of file otbRandomForestsMachineLearningModel.h.

◆ TargetValueType

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

Definition at line 48 of file otbRandomForestsMachineLearningModel.h.

◆ VariableImportanceMatrixType

template<class TInputValue , class TTargetValue >
typedef itk::VariableSizeMatrix<float> otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::VariableImportanceMatrixType

Definition at line 54 of file otbRandomForestsMachineLearningModel.h.

Constructor & Destructor Documentation

◆ RandomForestsMachineLearningModel() [1/2]

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

◆ ~RandomForestsMachineLearningModel()

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

Destructor

◆ RandomForestsMachineLearningModel() [2/2]

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

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

Member Function Documentation

◆ CanReadFile()

template<class TInputValue , class TOutputValue >
bool otb::RandomForestsMachineLearningModel< 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 159 of file otbRandomForestsMachineLearningModel.hxx.

References CV_TYPE_NAME_ML_RTREES.

◆ CanWriteFile()

template<class TInputValue , class TOutputValue >
bool otb::RandomForestsMachineLearningModel< 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 187 of file otbRandomForestsMachineLearningModel.hxx.

◆ CreateAnother()

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

Run-time type information (and related methods).

◆ DoPredict()

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

Predict values using the model

Definition at line 113 of file otbRandomForestsMachineLearningModel.hxx.

◆ GetCalculateVariableImportance()

template<class TInputValue , class TTargetValue >
virtual bool otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetCalculateVariableImportance ( )
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetComputeMargin()

template<class TInputValue , class TTargetValue >
virtual bool otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetComputeMargin ( )
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetComputeSurrogateSplit()

template<class TInputValue , class TTargetValue >
virtual bool otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetComputeSurrogateSplit ( )
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetForestAccuracy()

template<class TInputValue , class TTargetValue >
virtual float otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetForestAccuracy ( )
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetMaxDepth()

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

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetMaxNumberOfCategories()

template<class TInputValue , class TTargetValue >
virtual int otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetMaxNumberOfCategories ( )
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetMaxNumberOfTrees()

template<class TInputValue , class TTargetValue >
virtual int otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetMaxNumberOfTrees ( )
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetMaxNumberOfVariables()

template<class TInputValue , class TTargetValue >
virtual int otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetMaxNumberOfVariables ( )
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetMinSampleCount()

template<class TInputValue , class TTargetValue >
virtual int otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetMinSampleCount ( )
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetNameOfClass()

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

Run-time type information (and related methods).

◆ GetPriors()

template<class TInputValue , class TTargetValue >
std::vector<float> otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetPriors ( ) const
inline

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

Definition at line 100 of file otbRandomForestsMachineLearningModel.h.

◆ GetRegressionAccuracy()

template<class TInputValue , class TTargetValue >
virtual double otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetRegressionAccuracy ( )
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetTerminationCriteria()

template<class TInputValue , class TTargetValue >
virtual int otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::GetTerminationCriteria ( )
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ GetTrainError()

template<class TInputValue , class TOutputValue >
float otb::RandomForestsMachineLearningModel< TInputValue, TOutputValue >::GetTrainError

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

Definition at line 54 of file otbRandomForestsMachineLearningModel.hxx.

References CV_VAR_CATEGORICAL, and CV_VAR_NUMERICAL.

◆ GetVariableImportance()

template<class TInputValue , class TOutputValue >
RandomForestsMachineLearningModel< TInputValue, TOutputValue >::VariableImportanceMatrixType otb::RandomForestsMachineLearningModel< TInputValue, TOutputValue >::GetVariableImportance

Returns a matrix containing variable importance

Definition at line 194 of file otbRandomForestsMachineLearningModel.hxx.

◆ Load()

template<class TInputValue , class TOutputValue >
void otb::RandomForestsMachineLearningModel< 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 152 of file otbRandomForestsMachineLearningModel.hxx.

◆ New()

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

Run-time type information (and related methods).

◆ operator=()

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

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ PrintSelf()

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

PrintSelf method

Definition at line 210 of file otbRandomForestsMachineLearningModel.hxx.

◆ Save()

template<class TInputValue , class TOutputValue >
void otb::RandomForestsMachineLearningModel< 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 142 of file otbRandomForestsMachineLearningModel.hxx.

◆ SetCalculateVariableImportance()

template<class TInputValue , class TTargetValue >
virtual void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetCalculateVariableImportance ( bool  _arg)
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ SetComputeMargin()

template<class TInputValue , class TTargetValue >
virtual void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetComputeMargin ( bool  _arg)
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ SetComputeSurrogateSplit()

template<class TInputValue , class TTargetValue >
virtual void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetComputeSurrogateSplit ( bool  _arg)
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ SetForestAccuracy()

template<class TInputValue , class TTargetValue >
virtual void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetForestAccuracy ( float  _arg)
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ SetMaxDepth()

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

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ SetMaxNumberOfCategories()

template<class TInputValue , class TTargetValue >
virtual void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetMaxNumberOfCategories ( int  _arg)
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ SetMaxNumberOfTrees()

template<class TInputValue , class TTargetValue >
virtual void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetMaxNumberOfTrees ( int  _arg)
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ SetMaxNumberOfVariables()

template<class TInputValue , class TTargetValue >
virtual void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetMaxNumberOfVariables ( int  _arg)
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ SetMinSampleCount()

template<class TInputValue , class TTargetValue >
virtual void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetMinSampleCount ( int  _arg)
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ SetPriors()

template<class TInputValue , class TTargetValue >
void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetPriors ( const std::vector< float > &  priors)
inline

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

Definition at line 105 of file otbRandomForestsMachineLearningModel.h.

◆ SetRegressionAccuracy()

template<class TInputValue , class TTargetValue >
virtual void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetRegressionAccuracy ( double  _arg)
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ SetTerminationCriteria()

template<class TInputValue , class TTargetValue >
virtual void otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::SetTerminationCriteria ( int  _arg)
virtual

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

◆ Train()

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

Train the machine learning model

Implements otb::MachineLearningModel< TInputValue, TTargetValue >.

Definition at line 77 of file otbRandomForestsMachineLearningModel.hxx.

References CV_VAR_CATEGORICAL, and CV_VAR_NUMERICAL.

Member Data Documentation

◆ m_CalculateVariableImportance

template<class TInputValue , class TTargetValue >
bool otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_CalculateVariableImportance
private

If true then variable importance will be calculated and then it can be retrieved by CvRTreesWrapper::get_var_importance().

Definition at line 207 of file otbRandomForestsMachineLearningModel.h.

◆ m_ComputeMargin

template<class TInputValue , class TTargetValue >
bool otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_ComputeMargin
private

Whether to compute margin (difference in probability between the 2 most voted classes) instead of confidence (probability of the most voted class) in prediction

Definition at line 230 of file otbRandomForestsMachineLearningModel.h.

◆ m_ComputeSurrogateSplit

template<class TInputValue , class TTargetValue >
bool otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_ComputeSurrogateSplit
private

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

Definition at line 171 of file otbRandomForestsMachineLearningModel.h.

◆ m_ForestAccuracy

template<class TInputValue , class TTargetValue >
float otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_ForestAccuracy
private

Sufficient accuracy (OOB error)

Definition at line 222 of file otbRandomForestsMachineLearningModel.h.

◆ m_MaxDepth

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

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

Definition at line 161 of file otbRandomForestsMachineLearningModel.h.

◆ m_MaxNumberOfCategories

template<class TInputValue , class TTargetValue >
int otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_MaxNumberOfCategories
private

Cluster possible values of a categorical variable into $ K \leq MaxCategories $ clusters to find a suboptimal split. If a discrete variable, on which the training procedure tries to make a split, takes more than max_categories values, the precise best subset estimation may take a very long time because the algorithm is exponential. Instead, many decision trees engines (including ML) try to find sub-optimal split in this case by clustering all the samples into max categories clusters that is some categories are merged together. The clustering is applied only in n>2-class classification problems for categorical variables with N > max_categories possible values. In case of regression and 2-class classification the optimal split can be found efficiently without employing clustering, thus the parameter is not used in these cases.

Definition at line 187 of file otbRandomForestsMachineLearningModel.h.

◆ m_MaxNumberOfTrees

template<class TInputValue , class TTargetValue >
int otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_MaxNumberOfTrees
private

The maximum number of trees in the forest (surprise, surprise). Typically the more trees you have the better the accuracy. However, the improvement in accuracy generally diminishes and asymptotes pass a certain number of trees. Also to keep in mind, the number of tree increases the prediction time linearly.

Definition at line 219 of file otbRandomForestsMachineLearningModel.h.

◆ m_MaxNumberOfVariables

template<class TInputValue , class TTargetValue >
int otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_MaxNumberOfVariables
private

The size of the randomly selected subset of features at each tree node and that are used to find the best split(s). If you set it to 0 then the size will be set to the square root of the total number of features.

Definition at line 212 of file otbRandomForestsMachineLearningModel.h.

◆ m_MinSampleCount

template<class TInputValue , class TTargetValue >
int otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_MinSampleCount
private

minimum samples required at a leaf node for it to be split. A reasonable value is a small percentage of the total data e.g. 1%.

Definition at line 165 of file otbRandomForestsMachineLearningModel.h.

◆ m_Priors

template<class TInputValue , class TTargetValue >
std::vector<float> otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_Priors
private

The array of a priori class probabilities, sorted by the class label value. The parameter can be used to tune the decision tree preferences toward a certain class. For example, if you want to detect some rare anomaly occurrence, the training base will likely contain much more normal cases than anomalies, so a very good classification performance will be achieved just by considering every case as normal. To avoid this, the priors can be specified, where the anomaly probability is artificially increased (up to 0.5 or even greater), so the weight of the misclassified anomalies becomes much bigger, and the tree is adjusted properly. You can also think about this parameter as weights of prediction categories which determine relative weights that you give to misclassification. That is, if the weight of the first category is 1 and the weight of the second category is 10, then each mistake in predicting the second category is equivalent to making 10 mistakes in predicting the first category.

Definition at line 203 of file otbRandomForestsMachineLearningModel.h.

◆ m_RegressionAccuracy

template<class TInputValue , class TTargetValue >
float otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_RegressionAccuracy
private

Termination criteria for regression trees. If all absolute differences between an estimated value in a node and values of train samples in this node are less than this parameter then the node will not be split

Definition at line 170 of file otbRandomForestsMachineLearningModel.h.

◆ m_RFModel

template<class TInputValue , class TTargetValue >
cv::Ptr<CvRTreesWrapper> otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_RFModel
private

The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. The optimal value can be obtained using cross validation or other suitable methods.

Definition at line 156 of file otbRandomForestsMachineLearningModel.h.

◆ m_TerminationCriteria

template<class TInputValue , class TTargetValue >
int otb::RandomForestsMachineLearningModel< TInputValue, TTargetValue >::m_TerminationCriteria
private

The type of the termination criteria

Definition at line 225 of file otbRandomForestsMachineLearningModel.h.


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