21 #ifndef otbSVMMarginSampler_h
22 #define otbSVMMarginSampler_h
24 #include "itkSampleClassifierFilter.h"
25 #include "itkVectorImage.h"
37 template <
class TSample,
class TModel>
38 class ITK_EXPORT
SVMMarginSampler :
public itk::Statistics::SampleClassifierFilter<TSample>
43 typedef itk::Statistics::SampleClassifierFilter<TSample>
Superclass;
53 typedef typename Superclass::MembershipSampleType
OutputType;
65 bool resp = l2.second > l1.second;
73 itkSetMacro(NumberOfCandidates,
unsigned int);
74 itkGetMacro(NumberOfCandidates,
unsigned int);
84 return m_MarginSamples;
92 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
95 void GenerateData()
override;
96 virtual void DoMarginSampling();
112 #ifndef OTB_MANUAL_INSTANTIATION
Implement one iteration of active learning by margin.
itk::SmartPointer< Self > Pointer
std::vector< IndexAndDistanceType > IndexAndDistanceVectorType
itk::SmartPointer< const Self > ConstPointer
IndexVectorType m_MarginSamples
TSample::MeasurementVectorType MeasurementVectorType
const IndexVectorType & GetMarginSamples()
itkGetObjectMacro(Model, SVMModelType)
unsigned int m_NumberOfCandidates
Superclass::MembershipSampleType OutputType
TSample::MeasurementType MeasurementType
~SVMMarginSampler() override
std::pair< unsigned int, double > IndexAndDistanceType
std::vector< unsigned int > IndexVectorType
static bool Compare(const IndexAndDistanceType &l1, const IndexAndDistanceType &l2)
SVMModelType::Pointer SVMModelPointer
itk::Statistics::SampleClassifierFilter< TSample > Superclass
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.