diff --git a/Code/Learning/otbLibSVMMachineLearningModel.h b/Code/Learning/otbLibSVMMachineLearningModel.h index 410840db686c6adb1f07b0d8467565daaf0b42f6..914542b6843b16d442b713a9960125313abf78c9 100644 --- a/Code/Learning/otbLibSVMMachineLearningModel.h +++ b/Code/Learning/otbLibSVMMachineLearningModel.h @@ -96,6 +96,9 @@ public: itkGetMacro(ParameterOptimization, bool); itkSetMacro(ParameterOptimization, bool); + + itkGetMacro(DoProbabilityEstimates, bool); + itkSetMacro(DoProbabilityEstimates, bool); // itkGetMacro(Epsilon, int); // itkSetMacro(Epsilon, int); @@ -117,6 +120,7 @@ private: int m_KernelType; float m_C; bool m_ParameterOptimization; + bool m_DoProbabilityEstimates; typename SVMEstimatorType::Pointer m_SVMestimator; }; } // end namespace otb diff --git a/Code/Learning/otbLibSVMMachineLearningModel.txx b/Code/Learning/otbLibSVMMachineLearningModel.txx index 131db547b7a1dd90aa72e12a6414f39c5c261a24..bbdbc02a0e3c1df9b047ecffe66ff633cbbe4222 100644 --- a/Code/Learning/otbLibSVMMachineLearningModel.txx +++ b/Code/Learning/otbLibSVMMachineLearningModel.txx @@ -39,6 +39,7 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue> m_C = 1.0; // m_Epsilon = 1e-6; m_ParameterOptimization = false; + m_DoProbabilityEstimates = false; m_SVMestimator = SVMEstimatorType::New(); } @@ -67,6 +68,7 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue> m_SVMestimator->SetC(m_C); m_SVMestimator->SetKernelType(m_KernelType); m_SVMestimator->SetParametersOptimization(m_ParameterOptimization); + m_SVMestimator->DoProbabilityEstimates(m_DoProbabilityEstimates); m_SVMestimator->SetInputSampleList(this->GetInputListSample()); m_SVMestimator->SetTrainingSampleList(this->GetTargetListSample());