Commit a7f0ec03 authored by Guillaume Pasero's avatar Guillaume Pasero

REFAC: remove GradientBoostedTree, as done in OpenCV 3

parent b8695a74
......@@ -87,7 +87,6 @@ The current list of classifiers available through the same generic interface wit
\item \textbf{Boost}: Boost classifier based on OpenCV.
\item \textbf{DT}: Decision Tree classifier based on OpenCV.
\item \textbf{RF}: Random Forests classifier based on the Random Trees in OpenCV.
\item \textbf{GBT}: Gradient Boosted Tree classifier based on OpenCV (removed in version 3).
\item \textbf{KNN}: K-Nearest Neighbors classifier based on OpenCV.
\item \textbf{ANN}: Artificial Neural Network classifier based on OpenCV.
\item \textbf{SharkRF} : Random Forests classifier based on Shark.
......
......@@ -122,7 +122,6 @@ private:
"* LibSVM: difference between the two highest probabilities (needs a model with probability estimates, so that classes probabilities can be computed for each sample)\n"
"* Boost: sum of votes\n"
"* DecisionTree: (not supported)\n"
"* GradientBoostedTree: (not supported)\n"
"* KNearestNeighbors: number of neighbors with the same label\n"
"* NeuralNetwork: difference between the two highest responses\n"
"* NormalBayes: (not supported)\n"
......
......@@ -135,7 +135,6 @@ private:
"* LibSVM: difference between the two highest probabilities (needs a model with probability estimates, so that classes probabilities can be computed for each sample)\n"
"* Boost: sum of votes\n"
"* DecisionTree: (not supported)\n"
"* GradientBoostedTree: (not supported)\n"
"* KNearestNeighbors: number of neighbors with the same label\n"
"* NeuralNetwork: difference between the two highest responses\n"
"* NormalBayes: (not supported)\n"
......
......@@ -165,7 +165,6 @@ private:
void InitBoostParams();
void InitSVMParams();
void InitDecisionTreeParams();
void InitGradientBoostedTreeParams();
void InitNeuralNetworkParams();
void InitNormalBayesParams();
void InitRandomForestsParams();
......@@ -180,9 +179,6 @@ private:
void TrainDecisionTree(typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath);
void TrainGradientBoostedTree(typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath);
void TrainNeuralNetwork(typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath);
......@@ -218,7 +214,6 @@ private:
#ifdef OTB_USE_OPENCV
#include "otbTrainBoost.hxx"
#include "otbTrainDecisionTree.hxx"
#include "otbTrainGradientBoostedTree.hxx"
#include "otbTrainKNN.hxx"
#include "otbTrainNeuralNetwork.hxx"
#include "otbTrainNormalBayes.hxx"
......
......@@ -102,7 +102,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
InitBoostParams(); // Regression not supported
}
InitDecisionTreeParams();
InitGradientBoostedTreeParams();
InitNeuralNetworkParams();
if (!m_RegressionFlag)
{
......@@ -228,14 +227,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
otbAppLogFATAL("Module OPENCV is not installed. You should consider turning OTB_USE_OPENCV on during cmake configuration.");
#endif
}
else if (modelName == "gbt")
{
#ifdef OTB_USE_OPENCV
TrainGradientBoostedTree(trainingListSample, trainingLabeledListSample, modelPath);
#else
otbAppLogFATAL("Module OPENCV is not installed. You should consider turning OTB_USE_OPENCV on during cmake configuration.");
#endif
}
else if (modelName == "ann")
{
#ifdef OTB_USE_OPENCV
......
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbTrainGradientBoostedTree_hxx
#define otbTrainGradientBoostedTree_hxx
#include "otbLearningApplicationBase.h"
#include "otbGradientBoostedTreeMachineLearningModel.h"
namespace otb
{
namespace Wrapper
{
template <class TInputValue, class TOutputValue>
void
LearningApplicationBase<TInputValue,TOutputValue>
::InitGradientBoostedTreeParams()
{
// disable GBTree model with OpenCV 3 (not implemented)
#ifndef OTB_OPENCV_3
AddChoice("classifier.gbt", "Gradient Boosted Tree classifier");
SetParameterDescription(
"classifier.gbt",
"http://docs.opencv.org/modules/ml/doc/gradient_boosted_trees.html");
if (m_RegressionFlag)
{
AddParameter(ParameterType_Choice, "classifier.gbt.t", "Loss Function Type");
SetParameterDescription("classifier.gbt.t","Type of loss functionused for training.");
AddChoice("classifier.gbt.t.sqr","Squared Loss");
AddChoice("classifier.gbt.t.abs","Absolute Loss");
AddChoice("classifier.gbt.t.hub","Huber Loss");
}
//WeakCount
AddParameter(ParameterType_Int, "classifier.gbt.w", "Number of boosting algorithm iterations");
SetParameterInt("classifier.gbt.w",200);
SetParameterDescription(
"classifier.gbt.w",
"Number \"w\" of boosting algorithm iterations, with w*K being the total number of trees in "
"the GBT model, where K is the output number of classes.");
//Shrinkage
AddParameter(ParameterType_Float, "classifier.gbt.s", "Regularization parameter");
SetParameterFloat("classifier.gbt.s",0.01);
SetParameterDescription("classifier.gbt.s", "Regularization parameter.");
//SubSamplePortion
AddParameter(ParameterType_Float, "classifier.gbt.p",
"Portion of the whole training set used for each algorithm iteration");
SetParameterFloat("classifier.gbt.p",0.8);
SetParameterDescription(
"classifier.gbt.p",
"Portion of the whole training set used for each algorithm iteration. The subset is generated randomly.");
//MaxDepth
AddParameter(ParameterType_Int, "classifier.gbt.max", "Maximum depth of the tree");
SetParameterInt("classifier.gbt.max",3);
SetParameterDescription(
"classifier.gbt.max", "The training algorithm attempts to split each node while its depth is smaller than the maximum "
"possible depth of the tree. The actual depth may be smaller if the other termination criteria are met, and/or "
"if the tree is pruned.");
#endif
}
template <class TInputValue, class TOutputValue>
void
LearningApplicationBase<TInputValue,TOutputValue>
::TrainGradientBoostedTree(typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath)
{
#ifdef OTB_OPENCV_3
(void) trainingListSample;
(void) trainingLabeledListSample;
(void) modelPath;
#else
typedef otb::GradientBoostedTreeMachineLearningModel<InputValueType, OutputValueType> GradientBoostedTreeType;
typename GradientBoostedTreeType::Pointer classifier = GradientBoostedTreeType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
classifier->SetTargetListSample(trainingLabeledListSample);
classifier->SetWeakCount(GetParameterInt("classifier.gbt.w"));
classifier->SetShrinkage(GetParameterFloat("classifier.gbt.s"));
classifier->SetSubSamplePortion(GetParameterFloat("classifier.gbt.p"));
classifier->SetMaxDepth(GetParameterInt("classifier.gbt.max"));
if (m_RegressionFlag)
{
switch (GetParameterInt("classifier.gbt.t"))
{
case 0: // SQUARED_LOSS
classifier->SetLossFunctionType(CvGBTrees::SQUARED_LOSS);
break;
case 1: // ABSOLUTE_LOSS
classifier->SetLossFunctionType(CvGBTrees::ABSOLUTE_LOSS);
break;
case 2: // HUBER_LOSS
classifier->SetLossFunctionType(CvGBTrees::HUBER_LOSS);
break;
default:
classifier->SetLossFunctionType(CvGBTrees::SQUARED_LOSS);
break;
}
}
else
{
classifier->SetLossFunctionType(CvGBTrees::DEVIANCE_LOSS);
}
classifier->Train();
classifier->Save(modelPath);
#endif
}
} //end namespace wrapper
} //end namespace otb
#endif
......@@ -75,7 +75,6 @@ set(libsvm_input "")
set(svm_input "")
set(boost_input "Water_Vegetation")
set(dt_input "")
set(gbt_input "")
set(ann_input "")
set(bayes_input "")
set(rf_input "")
......@@ -90,7 +89,6 @@ set(libsvm_output_format ".libsvm")
set(svm_output_format ".svm")
set(boost_output_format ".boost")
set(dt_output_format ".dt")
set(gbt_output_format ".gbt")
set(ann_output_format ".ann")
set(bayes_output_format ".bayes")
set(rf_output_format ".rf")
......@@ -103,7 +101,6 @@ set(libsvm_parameters "-classifier.libsvm.opt" "true" "-classifier.libsvm.prob"
#set(svm_parameters "-classifier.svm.opt" "true")
set(boost_parameters "")
set(dt_parameters "")
set(gbt_parameters "")
set(ann_parameters "-classifier.ann.sizes" "100")
set(bayes_parameters "")
set(rf_parameters "")
......@@ -126,11 +123,8 @@ set(classifierList)
#list(APPEND classifierList "LIBSVM")
#endif()
if(OTB_USE_OPENCV)
#list(APPEND classifierList "SVM" "BOOST" "DT" "GBT" "ANN" "BAYES" "RF" "KNN")
#list(APPEND classifierList "SVM" "BOOST" "DT" "ANN" "BAYES" "RF" "KNN")
list(APPEND classifierList "BOOST" "DT" "ANN" "BAYES" "RF" "KNN")
if(NOT OTB_OPENCV_3)
list(APPEND classifierList "GBT")
endif()
endif()
if(OTB_USE_SHARK)
list(APPEND classifierList "SHARKRF" "SHARKKM")
......
......@@ -56,7 +56,6 @@ namespace otb
* \sa KNearestNeighborsMachineLearningModel
* \sa DecisionTreeMachineLearningModel
* \sa RandomForestsMachineLearningModel
* \sa GradientBoostedTreeMachineLearningModel
* \sa NormalBayesMachineLearningModel
* \sa NeuralNetworkMachineLearningModel
* \sa SharkRandomForestsMachineLearningModel
......
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbGradientBoostedTreeMachineLearningModel_h
#define otbGradientBoostedTreeMachineLearningModel_h
#include "otbRequiresOpenCVCheck.h"
#include "itkLightObject.h"
#include "itkFixedArray.h"
#include "otbMachineLearningModel.h"
#ifndef OTB_OPENCV_3
class CvGBTrees;
namespace otb
{
template <class TInputValue, class TTargetValue>
class ITK_EXPORT GradientBoostedTreeMachineLearningModel
: public MachineLearningModel <TInputValue, TTargetValue>
{
public:
/** Standard class typedefs. */
typedef GradientBoostedTreeMachineLearningModel Self;
typedef MachineLearningModel<TInputValue, TTargetValue> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef typename Superclass::InputValueType InputValueType;
typedef typename Superclass::InputSampleType InputSampleType;
typedef typename Superclass::InputListSampleType InputListSampleType;
typedef typename Superclass::TargetValueType TargetValueType;
typedef typename Superclass::TargetSampleType TargetSampleType;
typedef typename Superclass::TargetListSampleType TargetListSampleType;
typedef typename Superclass::ConfidenceValueType ConfidenceValueType;
typedef typename Superclass::ProbaSampleType ProbaSampleType;
/** Run-time type information (and related methods). */
itkNewMacro(Self);
itkTypeMacro(GradientBoostedTreeMachineLearningModel, MachineLearningModel);
/** Type of the loss function used for training.
* It must be one of the following types: CvGBTrees::SQUARED_LOSS, CvGBTrees::ABSOLUTE_LOSS,
* CvGBTrees::HUBER_LOSS, CvGBTrees::DEVIANCE_LOSS.
* The first three types are used for regression problems, and the last one for classification.
* Default is CvGBTrees::DEVIANCE_LOSS
* \see http://docs.opencv.org/modules/ml/doc/gradient_boosted_trees.html#cvgbtreesparams-cvgbtreesparams
*/
itkGetMacro(LossFunctionType, int);
itkSetMacro(LossFunctionType, int);
/** Count of boosting algorithm iterations. weak_count*K is the total count of trees in the GBT model,
* where K is the output classes count (equal to one in case of a regression).
* Default is 200
* \see http://docs.opencv.org/modules/ml/doc/gradient_boosted_trees.html#cvgbtreesparams-cvgbtreesparams
*/
itkGetMacro(WeakCount, int);
itkSetMacro(WeakCount, int);
/** Regularization parameter.
* Default is 0.8
* \see http://docs.opencv.org/modules/ml/doc/gradient_boosted_trees.html#cvgbtreesparams-cvgbtreesparams
*/
itkGetMacro(Shrinkage, double);
itkSetMacro(Shrinkage, double);
/** Portion of the whole training set used for each algorithm iteration. Subset is generated randomly.
* For more information see http://www.salfordsystems.com/doc/StochasticBoostingSS.pdf.
* Default is 0.01
* \see http://docs.opencv.org/modules/ml/doc/gradient_boosted_trees.html#cvgbtreesparams-cvgbtreesparams
*/
itkGetMacro(SubSamplePortion, double);
itkSetMacro(SubSamplePortion, double);
/** Maximum depth of each decision tree.
* Default is 3
* \see http://docs.opencv.org/modules/ml/doc/gradient_boosted_trees.html#cvgbtreesparams-cvgbtreesparams
*/
itkGetMacro(MaxDepth, int);
itkSetMacro(MaxDepth, int);
/** If true then surrogate splits will be built.
* These splits allow working with missing data and compute variable importance correctly.
* Default is false
* \see http://docs.opencv.org/modules/ml/doc/gradient_boosted_trees.html#cvgbtreesparams-cvgbtreesparams
*/
itkGetMacro(UseSurrogates, bool);
itkSetMacro(UseSurrogates, bool);
/** Train the machine learning model */
void Train() override;
/** Save the model to file */
void Save(const std::string & filename, const std::string & name="") override;
/** Load the model from file */
void Load(const std::string & filename, const std::string & name="") override;
/**\name Classification model file compatibility tests */
//@{
/** Is the input model file readable and compatible with the corresponding classifier ? */
bool CanReadFile(const std::string &) override;
/** Is the input model file writable and compatible with the corresponding classifier ? */
bool CanWriteFile(const std::string &) override;
//@}
protected:
/** Constructor */
GradientBoostedTreeMachineLearningModel();
/** Destructor */
~GradientBoostedTreeMachineLearningModel() override;
/** Predict values using the model */
TargetSampleType DoPredict(const InputSampleType& input, ConfidenceValueType *quality=nullptr, ProbaSampleType *proba=nullptr) const override;
/** PrintSelf method */
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
private:
GradientBoostedTreeMachineLearningModel(const Self &) = delete;
void operator =(const Self&) = delete;
CvGBTrees * m_GBTreeModel;
int m_LossFunctionType;
int m_WeakCount;
double m_Shrinkage;
double m_SubSamplePortion;
int m_MaxDepth;
bool m_UseSurrogates;
};
} // end namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbGradientBoostedTreeMachineLearningModel.hxx"
#endif
#endif
#endif
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbGradientBoostedTreeMachineLearningModel_hxx
#define otbGradientBoostedTreeMachineLearningModel_hxx
#include "otbGradientBoostedTreeMachineLearningModel.h"
#include "otbOpenCVUtils.h"
#include <fstream>
#include "itkMacro.h"
#ifndef OTB_OPENCV_3
namespace otb
{
template <class TInputValue, class TOutputValue>
GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue>
::GradientBoostedTreeMachineLearningModel() :
m_GBTreeModel (new CvGBTrees),
m_LossFunctionType(CvGBTrees::DEVIANCE_LOSS),//m_LossFunctionType(CvGBTrees::SQUARED_LOSS),
m_WeakCount(200),
m_Shrinkage(0.01),
m_SubSamplePortion(0.8),
m_MaxDepth(3),
m_UseSurrogates(false)
{
this->m_IsRegressionSupported = true;
}
template <class TInputValue, class TOutputValue>
GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue>
::~GradientBoostedTreeMachineLearningModel()
{
delete m_GBTreeModel;
}
/** Train the machine learning model */
template <class TInputValue, class TOutputValue>
void
GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue>
::Train()
{
//convert listsample to opencv matrix
cv::Mat samples;
otb::ListSampleToMat<InputListSampleType>(this->GetInputListSample(), samples);
cv::Mat labels;
otb::ListSampleToMat<TargetListSampleType>(this->GetTargetListSample(),labels);
CvGBTreesParams params = CvGBTreesParams(m_LossFunctionType, m_WeakCount, m_Shrinkage, m_SubSamplePortion,
m_MaxDepth, m_UseSurrogates);
//train the Decision Tree model
cv::Mat var_type = cv::Mat(this->GetInputListSample()->GetMeasurementVectorSize() + 1, 1, CV_8U );
var_type.setTo(cv::Scalar(CV_VAR_NUMERICAL) ); // all inputs are numerical
if (!this->m_RegressionMode) //Classification
var_type.at<uchar>(this->GetInputListSample()->GetMeasurementVectorSize(), 0) = CV_VAR_CATEGORICAL;
m_GBTreeModel->train(samples,CV_ROW_SAMPLE,labels,cv::Mat(),cv::Mat(),var_type,cv::Mat(),params, false);
}
template <class TInputValue, class TOutputValue>
typename GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue>
::TargetSampleType
GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue>
::DoPredict(const InputSampleType & input, ConfidenceValueType *quality, ProbaSampleType *proba) const
{
//convert listsample to Mat
cv::Mat sample;
otb::SampleToMat<InputSampleType>(input,sample);
double result = m_GBTreeModel->predict(sample); //, cv::Mat(), false)->value;
TargetSampleType target;
target[0] = static_cast<TOutputValue>(result);
if (quality != nullptr)
{
if (!this->m_ConfidenceIndex)
{
itkExceptionMacro("Confidence index not available for this classifier !");
}
}
if (proba != nullptr && !this->m_ProbaIndex)
itkExceptionMacro("Probability per class not available for this classifier !");
return target;
}
template <class TInputValue, class TOutputValue>
void
GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue>
::Save(const std::string & filename, const std::string & name)
{
if (name == "")
m_GBTreeModel->save(filename.c_str(), nullptr);
else
m_GBTreeModel->save(filename.c_str(), name.c_str());
}
template <class TInputValue, class TOutputValue>
void
GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue>
::Load(const std::string & filename, const std::string & name)
{
if (name == "")
m_GBTreeModel->load(filename.c_str(), nullptr);
else
m_GBTreeModel->load(filename.c_str(), name.c_str());
}
template <class TInputValue, class TOutputValue>
bool
GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue>
::CanReadFile(const std::string & file)
{
std::ifstream ifs;
ifs.open(file);
if(!ifs)
{
std::cerr<<"Could not read file "<<file<<std::endl;
return false;
}
while (!ifs.eof())
{
std::string line;
std::getline(ifs, line);
//if (line.find(m_SVMModel->getName()) != std::string::npos)
if (line.find(CV_TYPE_NAME_ML_GBT) != std::string::npos)
{
//std::cout<<"Reading a "<<CV_TYPE_NAME_ML_GBT<<" model"<<std::endl;
return true;
}
}
ifs.close();
return false;
}
template <class TInputValue, class TOutputValue>
bool
GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue>
::CanWriteFile(const std::string & itkNotUsed(file))
{
return false;
}
template <class TInputValue, class TOutputValue>
void
GradientBoostedTreeMachineLearningModel<TInputValue,TOutputValue>
::PrintSelf(std::ostream& os, itk::Indent indent) const
{
// Call superclass implementation
Superclass::PrintSelf(os,indent);
}
} //end namespace otb
#endif
#endif
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbGradientBoostedTreeMachineLearningModelFactory_h
#define otbGradientBoostedTreeMachineLearningModelFactory_h
#include "otbRequiresOpenCVCheck.h"
#include "itkObjectFactoryBase.h"
#include "itkImageIOBase.h"
#ifndef OTB_OPENCV_3
namespace otb
{
/** \class GradientBoostedTreeMachineLearningModelFactory
* \brief Creation d'un instance d'un objet SVMMachineLearningModel utilisant les object factory.
*
* \ingroup OTBSupervised
*/
template <class TInputValue, class TTargetValue>
class ITK_EXPORT GradientBoostedTreeMachineLearningModelFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef GradientBoostedTreeMachineLearningModelFactory Self;
typedef itk::ObjectFactoryBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class methods used to interface with the registered factories. */
const char* GetITKSourceVersion(void) const override;
const char* GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(GradientBoostedTreeMachineLearningModelFactory, itk::ObjectFactoryBase);
/** Register one factory of this type */
static void RegisterOneFactory(void)
{
Pointer Factory = GradientBoostedTreeMachineLearningModelFactory::New();
itk::ObjectFactoryBase::RegisterFactory(Factory);
}
protected:
GradientBoostedTreeMachineLearningModelFactory();
~GradientBoostedTreeMachineLearningModelFactory() override;
private:
GradientBoostedTreeMachineLearningModelFactory(const Self &) = delete;
void operator =(const Self&) = delete;
};
} // end namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbGradientBoostedTreeMachineLearningModelFactory.hxx"
#endif
#endif
#endif