From abf16310a04a44bfcb37323892bc57d491afc816 Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Tue, 18 Apr 2017 17:51:44 +0200
Subject: [PATCH] REFAC: use SetDoProbabilityEstimates()

---
 .../Supervised/include/otbLibSVMMachineLearningModel.h        | 2 +-
 .../Supervised/include/otbLibSVMMachineLearningModel.txx      | 4 ++--
 .../0000209-SVMValidationLinearlySeparableProbEstimation.cxx  | 2 +-
 .../test/otbAtmosphericCorrectionsRSRSVMClassifier.cxx        | 2 +-
 .../test/otbReduceSpectralResponseSVMClassifier.cxx           | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.h b/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.h
index fc51f72bf9..a8baa08e58 100644
--- a/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.h
+++ b/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.h
@@ -154,7 +154,7 @@ public:
   itkGetMacro(ParameterOptimization, bool);
 
   /** Do probability estimates */
-  void DoProbabilityEstimates(bool prob)
+  void SetDoProbabilityEstimates(bool prob)
     {
     m_Parameters.probability = static_cast<int>(prob);
     }
diff --git a/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.txx b/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.txx
index f2e3f4dcc4..5890ae8ef5 100644
--- a/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.txx
+++ b/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.txx
@@ -44,7 +44,7 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue>
   this->SetC(1.0);
   this->SetEpsilon(1e-3);
   this->SetP(0.1);
-  this->DoProbabilityEstimates(false);
+  this->SetDoProbabilityEstimates(false);
   this->DoShrinking(true);
   this->SetCacheSize(40); // MB
   this->m_ParameterOptimization = false;
@@ -355,7 +355,7 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue>
   if (this->GetSVMType() == ONE_CLASS && this->GetDoProbabilityEstimates())
     {
     otbMsgDebugMacro(<< "Disabling SVM probability estimates for ONE_CLASS SVM type.");
-    this->DoProbabilityEstimates(false);
+    this->SetDoProbabilityEstimates(false);
     }
 
   const char* error_msg = svm_check_parameter(&m_Problem, &m_Parameters);
diff --git a/Modules/Learning/Supervised/test/0000209-SVMValidationLinearlySeparableProbEstimation.cxx b/Modules/Learning/Supervised/test/0000209-SVMValidationLinearlySeparableProbEstimation.cxx
index f349f7e1f8..5394d793ed 100644
--- a/Modules/Learning/Supervised/test/0000209-SVMValidationLinearlySeparableProbEstimation.cxx
+++ b/Modules/Learning/Supervised/test/0000209-SVMValidationLinearlySeparableProbEstimation.cxx
@@ -165,7 +165,7 @@ int main(int argc, char* argv[])
   estimator->SetTrainingSampleList(trainingLabels);
 
   estimator->SetKernelType(kernel);
-  estimator->DoProbabilityEstimates(probEstimate);
+  estimator->SetDoProbabilityEstimates(probEstimate);
 //  estimator->SetParametersOptimization(true);
   estimator->Update();
 
diff --git a/Modules/Radiometry/Simulation/test/otbAtmosphericCorrectionsRSRSVMClassifier.cxx b/Modules/Radiometry/Simulation/test/otbAtmosphericCorrectionsRSRSVMClassifier.cxx
index 05aa064d2d..70bd23fb68 100644
--- a/Modules/Radiometry/Simulation/test/otbAtmosphericCorrectionsRSRSVMClassifier.cxx
+++ b/Modules/Radiometry/Simulation/test/otbAtmosphericCorrectionsRSRSVMClassifier.cxx
@@ -262,7 +262,7 @@ int otbAtmosphericCorrectionsRSRSVMClassifier(int argc, char * argv[])
   SVMType::Pointer classifier = SVMType::New();
   classifier->SetInputListSample(sampleList);
   classifier->SetTargetListSample(trainingList);
-  classifier->DoProbabilityEstimates(true);
+  classifier->SetDoProbabilityEstimates(true);
   classifier->Train();
   classifier->Save("model.txt");
 
diff --git a/Modules/Radiometry/Simulation/test/otbReduceSpectralResponseSVMClassifier.cxx b/Modules/Radiometry/Simulation/test/otbReduceSpectralResponseSVMClassifier.cxx
index 75fd0149c4..71e0d85cd8 100644
--- a/Modules/Radiometry/Simulation/test/otbReduceSpectralResponseSVMClassifier.cxx
+++ b/Modules/Radiometry/Simulation/test/otbReduceSpectralResponseSVMClassifier.cxx
@@ -180,7 +180,7 @@ int otbReduceSpectralResponseSVMClassifier(int argc, char * argv[])
   model->SetC(1);
   model->SetEpsilon(0.001);
   model->SetP(0.1);
-  model->DoProbabilityEstimates(true);
+  model->SetDoProbabilityEstimates(true);
 
   model->Train();
   model->Save("model.txt");
-- 
GitLab