OTB  6.7.0
Orfeo Toolbox
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | 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 Self
ConstPointer
 
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 Self
ConstPointer
 
typedef MLMSampleTraits
< TInputValue >::ValueType 
InputValueType
 
typedef MLMSampleTraits
< TInputValue >::SampleType 
InputSampleType
 
typedef
itk::Statistics::ListSample
< InputSampleType
InputListSampleType
 
typedef MLMTargetTraits
< TTargetValue >::ValueType 
TargetValueType
 
typedef MLMTargetTraits
< TTargetValue >::SampleType 
TargetSampleType
 
typedef
itk::Statistics::ListSample
< TargetSampleType
TargetListSampleType
 
typedef MLMTargetTraits
< double >::ValueType 
ConfidenceValueType
 
typedef MLMTargetTraits
< double >::SampleType 
ConfidenceSampleType
 
typedef
itk::Statistics::ListSample
< ConfidenceSampleType
ConfidenceListSampleType
 
typedef
itk::VariableLengthVector
< double > 
ProbaSampleType
 
typedef
itk::Statistics::ListSample
< ProbaSampleType
ProbaListSampleType
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual unsigned GetK ()
 
virtual unsigned GetMaximumNumberOfIterations ()
 
virtual void SetK (unsigned _arg)
 
virtual void SetMaximumNumberOfIterations (unsigned _arg)
 
Classification model file compatibility tests
virtual bool CanReadFile (const std::string &) override
 
virtual bool CanWriteFile (const std::string &) override
 
void SetCentroidsFromData (const shark::Data< shark::RealVector > &data)
 
- Public Member Functions inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
bool HasConfidenceIndex () const
 
bool HasProbaIndex () const
 
 itkGetObjectMacro (ConfidenceListSample, ConfidenceListSampleType)
 
TargetSampleType Predict (const InputSampleType &input, ConfidenceValueType *quality=nullptr, ProbaSampleType *proba=nullptr) const
 
TargetListSampleType::Pointer PredictBatch (const InputListSampleType *input, ConfidenceListSampleType *quality=nullptr, ProbaListSampleType *proba=nullptr) const
 
virtual void SetDimension (unsigned int _arg)
 
virtual unsigned int GetDimension ()
 
virtual void SetInputListSample (InputListSampleType *_arg)
 
 itkGetObjectMacro (InputListSample, InputListSampleType)
 
virtual const InputListSampleTypeGetInputListSample () const
 
 itkGetObjectMacro (TargetListSample, TargetListSampleType)
 
virtual void SetTargetListSample (TargetListSampleType *_arg)
 
virtual bool GetRegressionMode ()
 
void SetRegressionMode (bool flag)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
virtual ModifiedTimeType GetMTime () const
 
virtual const std::string & GetObjectName () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Protected Member Functions

 SharkKMeansMachineLearningModel ()
 
virtual ~SharkKMeansMachineLearningModel ()
 
- Protected Member Functions inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
 MachineLearningModel ()
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 ~MachineLearningModel () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Member Functions

void operator= (const Self &)=delete
 
 SharkKMeansMachineLearningModel (const Self &)=delete
 

Private Attributes

bool m_CanRead
 
shark::Centroids m_Centroids
 
boost::shared_ptr
< ClusteringModelType
m_ClusteringModel
 
unsigned int m_K
 
unsigned int m_MaximumNumberOfIterations
 
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
 
void ExportCentroids (const std::string &filename)
 
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
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 
- Protected Attributes inherited from otb::MachineLearningModel< TInputValue, TTargetValue >
bool m_ConfidenceIndex
 
ConfidenceListSampleType::Pointer m_ConfidenceListSample
 
unsigned int m_Dimension
 
InputListSampleType::Pointer m_InputListSample
 
bool m_IsDoPredictBatchMultiThreaded
 
bool m_IsRegressionSupported
 
bool m_ProbaIndex
 
bool m_RegressionMode
 
TargetListSampleType::Pointer m_TargetListSample
 
InputListSampleType::Pointer m_ValidationListSample
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Detailed Description

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

Definition at line 73 of file otbSharkKMeansMachineLearningModel.h.

Member Typedef Documentation

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

Definition at line 93 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 94 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 90 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 89 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 88 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 80 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 84 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 83 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 82 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 79 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 92 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 91 of file otbSharkKMeansMachineLearningModel.h.

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

Standard class typedefs.

Definition at line 77 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 78 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 87 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 86 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 85 of file otbSharkKMeansMachineLearningModel.h.

Constructor & Destructor Documentation

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

Constructor

Definition at line 53 of file otbSharkKMeansMachineLearningModel.hxx.

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

Destructor

Definition at line 64 of file otbSharkKMeansMachineLearningModel.hxx.

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

Member Function Documentation

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 223 of file otbSharkKMeansMachineLearningModel.hxx.

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 240 of file otbSharkKMeansMachineLearningModel.hxx.

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

Run-time type information (and related methods).

Reimplemented from itk::Object.

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 89 of file otbSharkKMeansMachineLearningModel.hxx.

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

Train the machine learning model

Definition at line 120 of file otbSharkKMeansMachineLearningModel.hxx.

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

Train the machine learning model

Definition at line 248 of file otbSharkKMeansMachineLearningModel.hxx.

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

Get the number of class for the kMeans algorithm.

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

Get the maximum number of iteration for the kMeans algorithm.

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

Run-time type information (and related methods).

Reimplemented from otb::MachineLearningModel< TInputValue, TTargetValue >.

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 200 of file otbSharkKMeansMachineLearningModel.hxx.

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

Run-time type information (and related methods).

template<class TInputValue, class TTargetValue>
void otb::SharkKMeansMachineLearningModel< TInputValue, TTargetValue >::operator= ( const Self )
privatedelete
template<class TInputValue , class TOutputValue >
void SharkKMeansMachineLearningModel::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotectedvirtual

PrintSelf method

Reimplemented from itk::Object.

Definition at line 256 of file otbSharkKMeansMachineLearningModel.hxx.

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 185 of file otbSharkKMeansMachineLearningModel.hxx.

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 133 of file otbSharkKMeansMachineLearningModel.h.

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

Set the number of class for the kMeans algorithm.

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.

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

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

Definition at line 166 of file otbSharkKMeansMachineLearningModel.h.

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

Centroids results form kMeans

Definition at line 169 of file otbSharkKMeansMachineLearningModel.h.

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

shark Model could be SoftClusteringModel or HardClusteringModel

Definition at line 172 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 164 of file otbSharkKMeansMachineLearningModel.h.

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

Definition at line 165 of file otbSharkKMeansMachineLearningModel.h.


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