Commit abf16310 authored by Guillaume Pasero's avatar Guillaume Pasero

REFAC: use SetDoProbabilityEstimates()

parent 02975278
......@@ -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);
}
......
......@@ -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);
......
......@@ -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();
......
......@@ -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");
......
......@@ -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");
......
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