21 #ifndef otbKNearestNeighborsMachineLearningModel_h
22 #define otbKNearestNeighborsMachineLearningModel_h
26 #include "itkLightObject.h"
27 #include "itkFixedArray.h"
34 template <
class TInputValue,
class TTargetValue>
80 itkGetMacro(DecisionRule,
int);
81 itkSetMacro(DecisionRule,
int);
85 void Train()
override;
88 void Save(
const std::string& filename,
const std::string& name =
"")
override;
91 void Load(
const std::string& filename,
const std::string& name =
"")
override;
97 bool CanReadFile(
const std::string&)
override;
100 bool CanWriteFile(
const std::string&)
override;
111 TargetSampleType DoPredict(
const InputSampleType& input, ConfidenceValueType* quality =
nullptr, ProbaSampleType* proba =
nullptr)
const override;
114 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
118 void operator=(
const Self&) =
delete;
128 #ifndef OTB_MANUAL_INSTANTIATION