Commit 2ab96807 authored by Guillaume Pasero's avatar Guillaume Pasero

COMP: move specific includes and typedef to dedicated source files

parent 6fdc6336
......@@ -17,6 +17,7 @@
#ifndef otbTrainBoost_txx
#define otbTrainBoost_txx
#include "otbLearningApplicationBase.h"
#include "otbBoostMachineLearningModel.h"
namespace otb
{
......@@ -65,6 +66,7 @@ namespace Wrapper
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath)
{
typedef otb::BoostMachineLearningModel<InputValueType, OutputValueType> BoostType;
typename BoostType::Pointer boostClassifier = BoostType::New();
boostClassifier->SetRegressionMode(this->m_RegressionFlag);
boostClassifier->SetInputListSample(trainingListSample);
......
......@@ -17,6 +17,7 @@
#ifndef otbTrainDecisionTree_txx
#define otbTrainDecisionTree_txx
#include "otbLearningApplicationBase.h"
#include "otbDecisionTreeMachineLearningModel.h"
namespace otb
{
......@@ -96,6 +97,7 @@ LearningApplicationBase<TInputValue,TOutputValue>
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath)
{
typedef otb::DecisionTreeMachineLearningModel<InputValueType, OutputValueType> DecisionTreeType;
typename DecisionTreeType::Pointer classifier = DecisionTreeType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
......
......@@ -17,6 +17,7 @@
#ifndef otbTrainGradientBoostedTree_txx
#define otbTrainGradientBoostedTree_txx
#include "otbLearningApplicationBase.h"
#include "otbGradientBoostedTreeMachineLearningModel.h"
namespace otb
{
......@@ -92,6 +93,7 @@ LearningApplicationBase<TInputValue,TOutputValue>
(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);
......
......@@ -17,6 +17,7 @@
#ifndef otbTrainKNN_txx
#define otbTrainKNN_txx
#include "otbLearningApplicationBase.h"
#include "otbKNearestNeighborsMachineLearningModel.h"
namespace otb
{
......@@ -58,6 +59,7 @@ namespace Wrapper
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath)
{
typedef otb::KNearestNeighborsMachineLearningModel<InputValueType, OutputValueType> KNNType;
typename KNNType::Pointer knnClassifier = KNNType::New();
knnClassifier->SetRegressionMode(this->m_RegressionFlag);
knnClassifier->SetInputListSample(trainingListSample);
......
......@@ -17,6 +17,7 @@
#ifndef otbTrainLibSVM_txx
#define otbTrainLibSVM_txx
#include "otbLearningApplicationBase.h"
#include "otbLibSVMMachineLearningModel.h"
namespace otb
{
......@@ -80,6 +81,7 @@ namespace Wrapper
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath)
{
typedef otb::LibSVMMachineLearningModel<InputValueType, OutputValueType> LibSVMType;
typename LibSVMType::Pointer libSVMClassifier = LibSVMType::New();
libSVMClassifier->SetRegressionMode(this->m_RegressionFlag);
libSVMClassifier->SetInputListSample(trainingListSample);
......
......@@ -18,6 +18,7 @@
#define otbTrainNeuralNetwork_txx
#include <boost/lexical_cast.hpp>
#include "otbLearningApplicationBase.h"
#include "otbNeuralNetworkMachineLearningModel.h"
namespace otb
{
......@@ -130,6 +131,7 @@ LearningApplicationBase<TInputValue,TOutputValue>
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath)
{
typedef otb::NeuralNetworkMachineLearningModel<InputValueType, OutputValueType> NeuralNetworkType;
typename NeuralNetworkType::Pointer classifier = NeuralNetworkType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
......
......@@ -17,6 +17,7 @@
#ifndef otbTrainNormalBayes_txx
#define otbTrainNormalBayes_txx
#include "otbLearningApplicationBase.h"
#include "otbNormalBayesMachineLearningModel.h"
namespace otb
{
......@@ -41,6 +42,7 @@ namespace Wrapper
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath)
{
typedef otb::NormalBayesMachineLearningModel<InputValueType, OutputValueType> NormalBayesType;
typename NormalBayesType::Pointer classifier = NormalBayesType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
......
......@@ -17,6 +17,7 @@
#ifndef otbTrainRandomForests_txx
#define otbTrainRandomForests_txx
#include "otbLearningApplicationBase.h"
#include "otbRandomForestsMachineLearningModel.h"
namespace otb
{
......@@ -106,6 +107,7 @@ LearningApplicationBase<TInputValue,TOutputValue>
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath)
{
typedef otb::RandomForestsMachineLearningModel<InputValueType, OutputValueType> RandomForestType;
typename RandomForestType::Pointer classifier = RandomForestType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
......
......@@ -17,6 +17,7 @@
#ifndef otbTrainSVM_txx
#define otbTrainSVM_txx
#include "otbLearningApplicationBase.h"
#include "otbSVMMachineLearningModel.h"
namespace otb
{
......@@ -110,6 +111,7 @@ namespace Wrapper
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath)
{
typedef otb::SVMMachineLearningModel<InputValueType, OutputValueType> SVMType;
typename SVMType::Pointer SVMClassifier = SVMType::New();
SVMClassifier->SetRegressionMode(this->m_RegressionFlag);
SVMClassifier->SetInputListSample(trainingListSample);
......
......@@ -18,6 +18,7 @@
#define otbTrainSharkRandomForests_txx
#include "otbLearningApplicationBase.h"
#include "otbSharkRandomForestsMachineLearningModel.h"
namespace otb
{
......@@ -79,6 +80,7 @@ LearningApplicationBase<TInputValue,TOutputValue>
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath)
{
typedef otb::SharkRandomForestsMachineLearningModel<InputValueType, OutputValueType> SharkRandomForestType;
typename SharkRandomForestType::Pointer classifier = SharkRandomForestType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment