21 #ifndef otbLearningApplicationBase_h
22 #define otbLearningApplicationBase_h
24 #include "otbConfigure.h"
30 #include "itkListSample.h"
31 #include "itkVariableLengthVector.h"
74 template <
class TInputValue,
class TOutputValue>
105 itkGetConstReferenceMacro(SupervisedClassifier, std::vector<std::string>);
106 itkGetConstReferenceMacro(UnsupervisedClassifier, std::vector<std::string>);
128 void Train(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample, std::string modelPath);
131 typename TargetListSampleType::Pointer
Classify(
typename ListSampleType::Pointer validationListSample, std::string modelPath);
152 #ifdef OTB_USE_LIBSVM
153 void InitLibSVMParams();
155 void TrainLibSVM(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
156 std::string modelPath);
159 #ifdef OTB_USE_OPENCV
160 void InitBoostParams();
161 void InitSVMParams();
162 void InitDecisionTreeParams();
163 void InitNeuralNetworkParams();
164 void InitNormalBayesParams();
165 void InitRandomForestsParams();
166 void InitKNNParams();
168 void TrainBoost(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample, std::string modelPath);
169 void TrainSVM(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample, std::string modelPath);
170 void TrainDecisionTree(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
171 std::string modelPath);
172 void TrainNeuralNetwork(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
173 std::string modelPath);
174 void TrainNormalBayes(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
175 std::string modelPath);
176 void TrainRandomForests(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
177 std::string modelPath);
178 void TrainKNN(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample, std::string modelPath);
182 void InitSharkRandomForestsParams();
183 void TrainSharkRandomForests(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
184 std::string modelPath);
185 void InitSharkKMeansParams();
186 void TrainSharkKMeans(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
187 std::string modelPath);
194 #ifndef OTB_MANUAL_INSTANTIATION
196 #ifdef OTB_USE_OPENCV
205 #ifdef OTB_USE_LIBSVM