OTB  9.0.0
Orfeo Toolbox
Public Types | List of all members
otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue > Class Template Reference

#include <otbSharkKMeansMachineLearningModel.h>

+ Inheritance diagram for otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >:
+ Collaboration diagram for otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >:

Public Types

typedef shark::HardClusteringModel< shark::RealVector > ClusteringModelType
 
typedef ClusteringModelType::OutputType ClusteringOutputType
 
typedef Superclass::ConfidenceListSampleType ConfidenceListSampleType
 
typedef Superclass::ConfidenceSampleType ConfidenceSampleType
 
typedef Superclass::ConfidenceValueType ConfidenceValueType
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef Superclass::InputListSampleType InputListSampleType
 
typedef Superclass::InputSampleType InputSampleType
 
typedef Superclass::InputValueType InputValueType
 
typedef itk::SmartPointer< SelfPointer
 
typedef Superclass::ProbaListSampleType ProbaListSampleType
 
typedef Superclass::ProbaSampleType ProbaSampleType
 
typedef SharkKMeansMachineLearningModel Self
 
typedef MachineLearningModel< TInputValue, TTargetValue > Superclass
 
typedef Superclass::TargetListSampleType TargetListSampleType
 
typedef Superclass::TargetSampleType TargetSampleType
 
typedef Superclass::TargetValueType TargetValueType
 
- Public Types inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
typedef MachineLearningModel Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef MLMSampleTraits< TInputValue >::ValueType InputValueType
 
typedef MLMSampleTraits< TInputValue >::SampleType InputSampleType
 
typedef itk::Statistics::ListSample< InputSampleTypeInputListSampleType
 
typedef MLMTargetTraits< TTargetValue >::ValueType TargetValueType
 
typedef MLMTargetTraits< TTargetValue >::SampleType TargetSampleType
 
typedef itk::Statistics::ListSample< TargetSampleTypeTargetListSampleType
 
typedef MLMTargetTraits< double >::ValueType ConfidenceValueType
 
typedef MLMTargetTraits< double >::SampleType ConfidenceSampleType
 
typedef itk::Statistics::ListSample< ConfidenceSampleTypeConfidenceListSampleType
 
typedef itk::VariableLengthVector< double > ProbaSampleType
 
typedef itk::Statistics::ListSample< ProbaSampleTypeProbaListSampleType
 
static Pointer New ()
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
virtual void Train () override
 
virtual void Save (const std::string &filename, const std::string &name="") override
 
virtual void Load (const std::string &filename, const std::string &name="") override
 

Classification model file compatibility tests

unsigned int m_K
 
unsigned int m_MaximumNumberOfIterations
 
bool m_CanRead
 
shark::Centroids m_Centroids
 
std::shared_ptr< ClusteringModelTypem_ClusteringModel
 
virtual bool CanReadFile (const std::string &) override
 
virtual bool CanWriteFile (const std::string &) override
 
virtual unsigned GetMaximumNumberOfIterations ()
 
virtual void SetMaximumNumberOfIterations (unsigned _arg)
 
virtual unsigned GetK ()
 
virtual void SetK (unsigned _arg)
 
void SetCentroidsFromData (const shark::Data< shark::RealVector > &data)
 
void ExportCentroids (const std::string &filename)
 
 SharkKMeansMachineLearningModel ()
 
virtual ~SharkKMeansMachineLearningModel ()
 
virtual TargetSampleType DoPredict (const InputSampleType &input, ConfidenceValueType *quality=nullptr, ProbaSampleType *proba=nullptr) const override
 
virtual void DoPredictBatch (const InputListSampleType *, const unsigned int &startIndex, const unsigned int &size, TargetListSampleType *, ConfidenceListSampleType *=nullptr, ProbaListSampleType *=nullptr) const override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 SharkKMeansMachineLearningModel (const Self &)=delete
 
void operator= (const Self &)=delete
 

Additional Inherited Members

- Public Member Functions inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
virtual const char * GetNameOfClass () const
 
TargetSampleType Predict (const InputSampleType &input, ConfidenceValueType *quality=nullptr, ProbaSampleType *proba=nullptr) const
 
virtual void SetDimension (unsigned int _arg)
 
virtual unsigned int GetDimension ()
 
TargetListSampleType::Pointer PredictBatch (const InputListSampleType *input, ConfidenceListSampleType *quality=nullptr, ProbaListSampleType *proba=nullptr) const
 
bool HasConfidenceIndex () const
 
bool HasProbaIndex () const
 
virtual void SetInputListSample (InputListSampleType *_arg)
 
 itkGetObjectMacro (InputListSample, InputListSampleType)
 
virtual const InputListSampleTypeGetInputListSample () const
 
 itkGetObjectMacro (TargetListSample, TargetListSampleType)
 
 itkGetObjectMacro (ConfidenceListSample, ConfidenceListSampleType)
 
virtual void SetTargetListSample (TargetListSampleType *_arg)
 
virtual bool GetRegressionMode ()
 
void SetRegressionMode (bool flag)
 
- Protected Member Functions inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
 MachineLearningModel ()
 
 ~MachineLearningModel () override=default
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
- Protected Attributes inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
InputListSampleType::Pointer m_InputListSample
 
InputListSampleType::Pointer m_ValidationListSample
 
TargetListSampleType::Pointer m_TargetListSample
 
ConfidenceListSampleType::Pointer m_ConfidenceListSample
 
bool m_RegressionMode
 
bool m_IsRegressionSupported
 
bool m_ConfidenceIndex
 
bool m_ProbaIndex
 
bool m_IsDoPredictBatchMultiThreaded
 
unsigned int m_Dimension
 

Detailed Description

template<class TInputValue, class TTargetValue>
class otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >

Definition at line 82 of file otbSharkKMeansMachineLearningModel.h.

Member Typedef Documentation

◆ ClusteringModelType

template<class TInputValue , class TTargetValue >
typedef shark::HardClusteringModel<shark::RealVector> otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::ClusteringModelType

Definition at line 102 of file otbSharkKMeansMachineLearningModel.h.

◆ ClusteringOutputType

template<class TInputValue , class TTargetValue >
typedef ClusteringModelType::OutputType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::ClusteringOutputType

Definition at line 103 of file otbSharkKMeansMachineLearningModel.h.

◆ ConfidenceListSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::ConfidenceListSampleType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::ConfidenceListSampleType

Definition at line 99 of file otbSharkKMeansMachineLearningModel.h.

◆ ConfidenceSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::ConfidenceSampleType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::ConfidenceSampleType

Definition at line 98 of file otbSharkKMeansMachineLearningModel.h.

◆ ConfidenceValueType

template<class TInputValue , class TTargetValue >
typedef Superclass::ConfidenceValueType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::ConfidenceValueType

Definition at line 97 of file otbSharkKMeansMachineLearningModel.h.

◆ ConstPointer

template<class TInputValue , class TTargetValue >
typedef itk::SmartPointer<const Self> otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::ConstPointer

Definition at line 89 of file otbSharkKMeansMachineLearningModel.h.

◆ InputListSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::InputListSampleType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::InputListSampleType

Definition at line 93 of file otbSharkKMeansMachineLearningModel.h.

◆ InputSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::InputSampleType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::InputSampleType

Definition at line 92 of file otbSharkKMeansMachineLearningModel.h.

◆ InputValueType

template<class TInputValue , class TTargetValue >
typedef Superclass::InputValueType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::InputValueType

Definition at line 91 of file otbSharkKMeansMachineLearningModel.h.

◆ Pointer

template<class TInputValue , class TTargetValue >
typedef itk::SmartPointer<Self> otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::Pointer

Definition at line 88 of file otbSharkKMeansMachineLearningModel.h.

◆ ProbaListSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::ProbaListSampleType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::ProbaListSampleType

Definition at line 101 of file otbSharkKMeansMachineLearningModel.h.

◆ ProbaSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::ProbaSampleType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::ProbaSampleType

Definition at line 100 of file otbSharkKMeansMachineLearningModel.h.

◆ Self

template<class TInputValue , class TTargetValue >
typedef SharkKMeansMachineLearningModel otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::Self

Standard class typedefs.

Definition at line 86 of file otbSharkKMeansMachineLearningModel.h.

◆ Superclass

template<class TInputValue , class TTargetValue >
typedef MachineLearningModel<TInputValue, TTargetValue> otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::Superclass

Definition at line 87 of file otbSharkKMeansMachineLearningModel.h.

◆ TargetListSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::TargetListSampleType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::TargetListSampleType

Definition at line 96 of file otbSharkKMeansMachineLearningModel.h.

◆ TargetSampleType

template<class TInputValue , class TTargetValue >
typedef Superclass::TargetSampleType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::TargetSampleType

Definition at line 95 of file otbSharkKMeansMachineLearningModel.h.

◆ TargetValueType

template<class TInputValue , class TTargetValue >
typedef Superclass::TargetValueType otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::TargetValueType

Definition at line 94 of file otbSharkKMeansMachineLearningModel.h.

Constructor & Destructor Documentation

◆ SharkKMeansMachineLearningModel() [1/2]

template<class TInputValue , class TOutputValue >
SharkKMeansMachineLearningModel::SharkKMeansMachineLearningModel
protected

◆ ~SharkKMeansMachineLearningModel()

template<class TInputValue , class TOutputValue >
SharkKMeansMachineLearningModel::~SharkKMeansMachineLearningModel
protectedvirtual

Destructor

Definition at line 66 of file otbSharkKMeansMachineLearningModel.hxx.

◆ SharkKMeansMachineLearningModel() [2/2]

template<class TInputValue , class TTargetValue >
otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::SharkKMeansMachineLearningModel ( const Self )
privatedelete

Centroids results form kMeans

Member Function Documentation

◆ CanReadFile()

template<class TInputValue , class TOutputValue >
bool SharkKMeansMachineLearningModel::CanReadFile ( const std::string &  file)
overridevirtual

Is the input model file readable and compatible with the corresponding classifier ?

Implements otb::MachineLearningModel< TInputValue, TTargetValue >.

Definition at line 211 of file otbSharkKMeansMachineLearningModel.hxx.

◆ CanWriteFile()

template<class TInputValue , class TOutputValue >
bool SharkKMeansMachineLearningModel::CanWriteFile ( const std::string &  )
overridevirtual

Is the input model file writable and compatible with the corresponding classifier ?

Implements otb::MachineLearningModel< TInputValue, TTargetValue >.

Definition at line 226 of file otbSharkKMeansMachineLearningModel.hxx.

◆ CreateAnother()

template<class TInputValue , class TTargetValue >
virtual::itk::LightObject::Pointer otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::CreateAnother ( void  ) const

Run-time type information (and related methods).

◆ DoPredict()

template<class TInputValue , class TOutputValue >
SharkKMeansMachineLearningModel< TInputValue, TOutputValue >::TargetSampleType SharkKMeansMachineLearningModel::DoPredict ( const InputSampleType input,
ConfidenceValueType quality = nullptr,
ProbaSampleType proba = nullptr 
) const
overrideprotectedvirtual

Predict values using the model

Definition at line 87 of file otbSharkKMeansMachineLearningModel.hxx.

◆ DoPredictBatch()

template<class TInputValue , class TOutputValue >
void SharkKMeansMachineLearningModel::DoPredictBatch ( const InputListSampleType input,
const unsigned int &  startIndex,
const unsigned int &  size,
TargetListSampleType targets,
ConfidenceListSampleType quality = nullptr,
ProbaListSampleType proba = nullptr 
) const
overrideprotectedvirtual

Centroids results form kMeans

Definition at line 116 of file otbSharkKMeansMachineLearningModel.hxx.

◆ ExportCentroids()

template<class TInputValue , class TOutputValue >
void SharkKMeansMachineLearningModel::ExportCentroids ( const std::string &  filename)

Centroids results form kMeans

Definition at line 232 of file otbSharkKMeansMachineLearningModel.hxx.

◆ GetK()

template<class TInputValue , class TTargetValue >
virtual unsigned otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::GetK ( )
virtual

Get the number of class for the kMeans algorithm.

◆ GetMaximumNumberOfIterations()

template<class TInputValue , class TTargetValue >
virtual unsigned otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::GetMaximumNumberOfIterations ( )
virtual

Get the maximum number of iteration for the kMeans algorithm.

◆ GetNameOfClass()

template<class TInputValue , class TTargetValue >
virtual const char* otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

◆ Load()

template<class TInputValue , class TOutputValue >
void SharkKMeansMachineLearningModel::Load ( const std::string &  filename,
const std::string &  name = "" 
)
overridevirtual

Load the model from file

Implements otb::MachineLearningModel< TInputValue, TTargetValue >.

Definition at line 190 of file otbSharkKMeansMachineLearningModel.hxx.

◆ New()

template<class TInputValue , class TTargetValue >
static Pointer otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::New ( )
static

Run-time type information (and related methods).

◆ operator=()

template<class TInputValue , class TTargetValue >
void otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::operator= ( const Self )
privatedelete

Centroids results form kMeans

◆ PrintSelf()

template<class TInputValue , class TOutputValue >
void SharkKMeansMachineLearningModel::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

PrintSelf method

Definition at line 238 of file otbSharkKMeansMachineLearningModel.hxx.

◆ Save()

template<class TInputValue , class TOutputValue >
void SharkKMeansMachineLearningModel::Save ( const std::string &  filename,
const std::string &  name = "" 
)
overridevirtual

Save the model to file

Implements otb::MachineLearningModel< TInputValue, TTargetValue >.

Definition at line 177 of file otbSharkKMeansMachineLearningModel.hxx.

◆ SetCentroidsFromData()

template<class TInputValue , class TTargetValue >
void otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::SetCentroidsFromData ( const shark::Data< shark::RealVector > &  data)
inline

Initialize the centroids for the kmeans algorithm

Definition at line 142 of file otbSharkKMeansMachineLearningModel.h.

◆ SetK()

template<class TInputValue , class TTargetValue >
virtual void otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::SetK ( unsigned  _arg)
virtual

Set the number of class for the kMeans algorithm.

◆ SetMaximumNumberOfIterations()

template<class TInputValue , class TTargetValue >
virtual void otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::SetMaximumNumberOfIterations ( unsigned  _arg)
virtual

Set the maximum number of iteration for the kMeans algorithm.

◆ Train()

template<class TInputValue , class TOutputValue >
void SharkKMeansMachineLearningModel::Train
overridevirtual

Train the machine learning model

Implements otb::MachineLearningModel< TInputValue, TTargetValue >.

Definition at line 72 of file otbSharkKMeansMachineLearningModel.hxx.

Member Data Documentation

◆ m_CanRead

template<class TInputValue , class TTargetValue >
bool otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::m_CanRead
private

Centroids results form kMeans

Definition at line 174 of file otbSharkKMeansMachineLearningModel.h.

◆ m_Centroids

template<class TInputValue , class TTargetValue >
shark::Centroids otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::m_Centroids
private

◆ m_ClusteringModel

template<class TInputValue , class TTargetValue >
std::shared_ptr<ClusteringModelType> otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::m_ClusteringModel
private

shark Model could be SoftClusteringModel or HardClusteringModel

Definition at line 180 of file otbSharkKMeansMachineLearningModel.h.

Referenced by otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::SharkKMeansMachineLearningModel().

◆ m_K

template<class TInputValue , class TTargetValue >
unsigned int otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::m_K
private

Centroids results form kMeans

Definition at line 172 of file otbSharkKMeansMachineLearningModel.h.

◆ m_MaximumNumberOfIterations

template<class TInputValue , class TTargetValue >
unsigned int otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::m_MaximumNumberOfIterations
private

Centroids results form kMeans

Definition at line 173 of file otbSharkKMeansMachineLearningModel.h.


The documentation for this class was generated from the following files: