21 #ifndef otbRandomForestsMachineLearningModel_h
22 #define otbRandomForestsMachineLearningModel_h
26 #include "itkLightObject.h"
27 #include "itkFixedArray.h"
29 #include "itkVariableSizeMatrix.h"
35 template <
class TInputValue,
class TTargetValue>
66 void Train()
override;
69 void Save(
const std::string& filename,
const std::string& name =
"")
override;
72 void Load(
const std::string& filename,
const std::string& name =
"")
override;
78 bool CanReadFile(
const std::string&)
override;
81 bool CanWriteFile(
const std::string&)
override;
85 itkGetMacro(MaxDepth,
int);
86 itkSetMacro(MaxDepth,
int);
88 itkGetMacro(MinSampleCount,
int);
89 itkSetMacro(MinSampleCount,
int);
91 itkGetMacro(RegressionAccuracy,
double);
92 itkSetMacro(RegressionAccuracy,
double);
94 itkGetMacro(ComputeSurrogateSplit,
bool);
95 itkSetMacro(ComputeSurrogateSplit,
bool);
97 itkGetMacro(MaxNumberOfCategories,
int);
98 itkSetMacro(MaxNumberOfCategories,
int);
110 itkGetMacro(CalculateVariableImportance,
bool);
111 itkSetMacro(CalculateVariableImportance,
bool);
113 itkGetMacro(MaxNumberOfVariables,
int);
114 itkSetMacro(MaxNumberOfVariables,
int);
116 itkGetMacro(MaxNumberOfTrees,
int);
117 itkSetMacro(MaxNumberOfTrees,
int);
119 itkGetMacro(ForestAccuracy,
float);
120 itkSetMacro(ForestAccuracy,
float);
122 itkGetMacro(TerminationCriteria,
int);
123 itkSetMacro(TerminationCriteria,
int);
125 itkGetMacro(ComputeMargin,
bool);
126 itkSetMacro(ComputeMargin,
bool);
131 float GetTrainError();
144 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
235 #ifndef OTB_MANUAL_INSTANTIATION
Wrapper for OpenCV Random Trees.
MachineLearningModel is the base class for all classifier objects (SVM, KNN, Random Forests,...
MLMTargetTraits< TConfidenceValue >::ValueType ConfidenceValueType
itk::VariableLengthVector< double > ProbaSampleType
MLMSampleTraits< TInputValue >::SampleType InputSampleType
MLMTargetTraits< TTargetValue >::SampleType TargetSampleType
MachineLearningModel< TInputValue, TTargetValue > Superclass
Superclass::TargetSampleType TargetSampleType
void operator=(const Self &)=delete
Superclass::InputListSampleType InputListSampleType
itk::VariableSizeMatrix< float > VariableImportanceMatrixType
int m_TerminationCriteria
Superclass::ProbaSampleType ProbaSampleType
int m_MaxNumberOfCategories
int m_MaxNumberOfVariables
Superclass::TargetValueType TargetValueType
cv::Ptr< CvRTreesWrapper > m_RFModel
std::vector< float > m_Priors
std::vector< float > GetPriors() const
itk::SmartPointer< Self > Pointer
bool m_CalculateVariableImportance
Superclass::InputValueType InputValueType
Superclass::TargetListSampleType TargetListSampleType
float m_RegressionAccuracy
Superclass::ConfidenceValueType ConfidenceValueType
RandomForestsMachineLearningModel(const Self &)=delete
bool m_ComputeSurrogateSplit
void SetPriors(const std::vector< float > &priors)
~RandomForestsMachineLearningModel() override=default
itk::SmartPointer< const Self > ConstPointer
RandomForestsMachineLearningModel Self
Superclass::InputSampleType InputSampleType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.