te::cl::KMeans< TTRAIN, TCLASSIFY > Class Template Reference

KMeans strategy for classification. Step-by-step: More...

#include <KMeans.h>

Classes

class  Parameters
 Classifier Parameters. More...
 

Public Member Functions

bool classify (TCLASSIFY &itBegin, TCLASSIFY &itEnd, const std::vector< unsigned int > &attributesIndices, std::vector< unsigned int > &classification, const bool enableProgressInterface) throw (te::cl::Exception)
 
bool initialize (const Parameters &params) throw (te::cl::Exception)
 
 KMeans ()
 
bool train (TTRAIN &itBegin, TTRAIN &itEnd, const std::vector< unsigned int > &attributesIndices, const std::vector< unsigned int > &labels, const bool enableProgressInterface) throw (te::cl::Exception)
 
 ~KMeans ()
 

Protected Member Functions

unsigned int getClassification (std::vector< double > values)
 

Protected Attributes

bool m_isInitialized
 True if this instance is initialized. More...
 
std::vector< std::vector< double > > m_KMeans
 The vector of K means. More...
 
Parameters m_parameters
 Internal execution parameters. More...
 

Detailed Description

template<class TTRAIN, class TCLASSIFY>
class te::cl::KMeans< TTRAIN, TCLASSIFY >

KMeans strategy for classification. Step-by-step:

  1. Define a random solution, creating K values of mean.
  2. Classify each input value according to the closest mean.
  3. Calculate new means using the classified pixels.
  4. Go back to step 2, or stop depending on the following checks: 4.1. Check if the new means are different from the previous iteration, using the convergence threshold. 4.2. Check if maximum number of iterations has achieved.

Definition at line 62 of file KMeans.h.

Constructor & Destructor Documentation

template<class TTRAIN , class TCLASSIFY >
te::cl::KMeans< TTRAIN, TCLASSIFY >::KMeans ( )
template<class TTRAIN , class TCLASSIFY >
te::cl::KMeans< TTRAIN, TCLASSIFY >::~KMeans ( )

Definition at line 170 of file KMeans.h.

Member Function Documentation

template<class TTRAIN , class TCLASSIFY >
bool te::cl::KMeans< TTRAIN, TCLASSIFY >::classify ( TCLASSIFY &  itBegin,
TCLASSIFY &  itEnd,
const std::vector< unsigned int > &  attributesIndices,
std::vector< unsigned int > &  classification,
const bool  enableProgressInterface 
)
throw (te::cl::Exception
)
template<class TTRAIN , class TCLASSIFY >
unsigned int te::cl::KMeans< TTRAIN, TCLASSIFY >::getClassification ( std::vector< double >  values)
protected
template<class TTRAIN , class TCLASSIFY >
bool te::cl::KMeans< TTRAIN, TCLASSIFY >::train ( TTRAIN &  itBegin,
TTRAIN &  itEnd,
const std::vector< unsigned int > &  attributesIndices,
const std::vector< unsigned int > &  labels,
const bool  enableProgressInterface 
)
throw (te::cl::Exception
)

Member Data Documentation

template<class TTRAIN , class TCLASSIFY >
bool te::cl::KMeans< TTRAIN, TCLASSIFY >::m_isInitialized
protected

True if this instance is initialized.

Definition at line 115 of file KMeans.h.

Referenced by te::cl::KMeans< TTRAIN, TCLASSIFY >::initialize(), and te::cl::KMeans< TTRAIN, TCLASSIFY >::KMeans().

template<class TTRAIN , class TCLASSIFY >
std::vector<std::vector<double> > te::cl::KMeans< TTRAIN, TCLASSIFY >::m_KMeans
protected
template<class TTRAIN , class TCLASSIFY >
Parameters te::cl::KMeans< TTRAIN, TCLASSIFY >::m_parameters
protected

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