Commit 279d6e9d authored by Victor Poughon's avatar Victor Poughon

REFAC: remove deprecated MachineLearningModel::PredictAll()

parent e4e82131
......@@ -192,10 +192,8 @@ private:
typedef otb::LibSVMMachineLearningModel<ValueType,LabelPixelType> LibSVMType;
LibSVMType::Pointer libSVMClassifier = LibSVMType::New();
libSVMClassifier->SetInputListSample(trainingListSample);
libSVMClassifier->SetTargetListSample(trainingLabeledListSample);
libSVMClassifier->Load(modelfile);
libSVMClassifier->PredictAll();
trainingLabeledListSample = libSVMClassifier->PredictBatch(trainingListSample);
otb::ogr::DataSource::Pointer source2 = otb::ogr::DataSource::New(shapefile, otb::ogr::DataSource::Modes::Update_LayerUpdate);
otb::ogr::Layer layer2 = source2->GetLayer(0);
......
......@@ -109,9 +109,8 @@ LearningApplicationBase<TInputValue,TOutputValue>
model->Load(modelPath);
model->SetRegressionMode(this->m_RegressionFlag);
model->SetInputListSample(validationListSample);
model->SetTargetListSample(predictedList);
model->PredictAll();
predictedList = model->PredictBatch(validationListSample, NULL);
// update reporter
dummyFilter->UpdateProgress(1.0f);
......
......@@ -126,9 +126,6 @@ public:
*/
typename TargetListSampleType::Pointer PredictBatch(const InputListSampleType * input, ConfidenceListSampleType * quality = ITK_NULLPTR) const;
/** THIS METHOD IS DEPRECATED AND SHOULD NOT BE USED. */
void PredictAll();
/**\name Classification model file manipulation */
//@{
/** Save the model to file */
......@@ -161,7 +158,7 @@ public:
//@{
/** Set the target labels (to be used before training) */
itkSetObjectMacro(TargetListSample,TargetListSampleType);
/** Get the target labels (to be used after PredictAll) */
/** Get the target labels */
itkGetObjectMacro(TargetListSample,TargetListSampleType);
//@}
......
......@@ -63,21 +63,6 @@ MachineLearningModel<TInputValue,TOutputValue,TConfidenceValue>
}
}
template <class TInputValue, class TOutputValue, class TConfidenceValue>
void
MachineLearningModel<TInputValue,TOutputValue,TConfidenceValue>
::PredictAll()
{
itkWarningMacro("MachineLearningModel::PredictAll() has been DEPRECATED. Use MachineLearningModel::PredictBatch() instead.");
typename TargetListSampleType::Pointer targets = this->GetTargetListSample();
targets->Clear();
typename TargetListSampleType::Pointer tmpTargets = this->PredictBatch(this->GetInputListSample());
targets->Graft(tmpTargets);
}
template <class TInputValue, class TOutputValue, class TConfidenceValue>
typename MachineLearningModel<TInputValue,TOutputValue,TConfidenceValue>
::TargetSampleType
......
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