21 #ifndef otbTrainNormalBayes_hxx
22 #define otbTrainNormalBayes_hxx
31 template <
class TInputValue,
class TOutputValue>
32 void LearningApplicationBase<TInputValue, TOutputValue>::InitNormalBayesParams()
34 AddChoice(
"classifier.bayes",
"Normal Bayes classifier");
35 SetParameterDescription(
"classifier.bayes",
"http://docs.opencv.org/modules/ml/doc/normal_bayes_classifier.html");
38 template <
class TInputValue,
class TOutputValue>
39 void LearningApplicationBase<TInputValue, TOutputValue>::TrainNormalBayes(
typename ListSampleType::Pointer trainingListSample,
40 typename TargetListSampleType::Pointer trainingLabeledListSample,
41 std::string modelPath)
44 typename NormalBayesType::Pointer classifier = NormalBayesType::New();
45 classifier->SetRegressionMode(this->m_RegressionFlag);
46 classifier->SetInputListSample(trainingListSample);
47 classifier->SetTargetListSample(trainingLabeledListSample);
49 classifier->Save(modelPath);