Hi Jordi,
SVMSampleListModelEstimator can be replaced by the class
LibSVMMachineLearningModel derived from the Machine Learning framework
added in 3.18. There are working similarly. I've extracted some code
from OTB tests related to those 2 classes:
for SVMSampleListModelEstimator:
typedef otb::SVMSampleListModelEstimator<ListSampleType,
TrainingListSampleType> EstimatorType;
EstimatorType::Pointer estimator = EstimatorType::New();
estimator->SetInputSampleList(generator->GetTrainingListSample());
estimator->SetTrainingSampleList(generator->GetTrainingListLabel());
estimator->Update();
estimator->GetModel()->SaveModel(outputModelFileName);
replace by:
typedef otb::LibSVMMachineLearningModel<InputValueType, TargetValueType>
SVMType;
InputListSampleType::Pointer samples = InputListSampleType::New();
TargetListSampleType::Pointer labels = TargetListSampleType::New();
TargetListSampleType::Pointer predicted = TargetListSampleType::New();
//Fill here in input list sample and target list samples
....
SVMType::Pointer classifier = SVMType::New();
classifier->SetInputListSample(samples);
classifier->SetTargetListSample(labels);
classifier->Train();
classifier->Save(outputModelFileName);
BTW I am asking myself if we should really have tagged this class as
deprecated in fact...This class was marked as deprecated when the new
MachineLearningModel framework was added. This new framework wrapped
mainly OpenCV classifiers but we have also wrapped LibSVM machine
learning model in the new framework to avoid to add OpenCV as mandatory
to perform classification in the lib. That the purpose of the
LibSVMMachineLearningModel The point is that the
LibSVMMachineLearningModel use the SVMSampleListModelEstimator
internally to . So if we keep libSVM implementation, there is no reason
to mark SVMSampleListModelEstimator as deprecated
...
Cheers,
Manuel
Le 27/01/2014 07:20, Jordi Inglada a écrit :
> Hi,
>
> I am cleaning some old code and I have noticed the deprecation of
> otb::SVMSampleListModelEstimator.
>
> What is the suggested class to use instead?
>
> I am aware of the refactoring of itk::Statistics::ListSample, but the class
> itself is not deprecated.
>
> Thanks.
>
> Jordi
>
--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html
You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.