A.I.M.S algorithms


aims::KmeansStrategy< T > Class Template Reference

#include <aims/classification/kmeansstrategy.h>

Inheritance diagram for aims::KmeansStrategy< T >:
Collaboration diagram for aims::KmeansStrategy< T >:

Public Member Functions

 KmeansStrategy (const KmeansStrategy< T > &kmeanStrat)
 
 KmeansStrategy (int nbIterations=50, DistanceType distanceType=NORM2SQR, int beginIndex=0, int endIndex=-1, const std::vector< Individuals< T > > &codeVector=std::vector< Individuals< T > >())
 
virtual ~KmeansStrategy ()
 
virtual ClassifStrategy< T > * clone () const
 
virtual double iterate (int &nbOfIterations, std::vector< std::list< Individuals< T > > > &classes)
 
virtual void init (std::string initializationType, int nbOfClasses, std::vector< std::list< Individuals< T > > > &classes)
 
virtual void analyse (const std::vector< std::list< Individuals< T > > > &classes)
 
virtual int aggregate (const Individuals< T > &individual)
 
virtual Individuals< T > getMeanValue (int classe)
 
virtual std::vector
< Individuals< T > > 
getMeanVector ()
 
virtual double globInertia (const std::vector< std::list< Individuals< T > > > &classes)
 
- Public Member Functions inherited from aims::ClassifStrategy< T >
 ClassifStrategy (int maxNbOfIterations=50)
 
virtual ~ClassifStrategy ()
 
bool isValidStrategy ()
 
void reset ()
 
bool isInit ()
 
bool isCodeVectorsGiven ()
 
int getMaxNbOfIterations () const
 

Protected Member Functions

virtual float distance (const Individuals< T > &individual, int classe)
 

Protected Attributes

float(* myDistance )(const std::vector< T > &ind1, const std::vector< T > &ind2, unsigned int beginIndex, unsigned int endIndex)
 
std::vector< Individuals< T > > myMeanVector
 
std::vector< Individuals< T > > myVarianceVector
 
int myBeginIndex
 
int myEndIndex
 
- Protected Attributes inherited from aims::ClassifStrategy< T >
int myMaxNbOfIterations
 
bool myValidStrategy
 
bool myInit
 
bool myCodeVectorsGiven
 

Detailed Description

template<class T>
class aims::KmeansStrategy< T >

Definition at line 55 of file kmeansstrategy.h.

Constructor & Destructor Documentation

template<class T >
aims::KmeansStrategy< T >::KmeansStrategy ( int  nbIterations = 50,
DistanceType  distanceType = NORM2SQR,
int  beginIndex = 0,
int  endIndex = -1,
const std::vector< Individuals< T > > &  codeVector = std::vector< Individuals<T> >() 
)
template<class T >
aims::KmeansStrategy< T >::~KmeansStrategy ( )
virtual

Definition at line 92 of file kmeansstrategy_d.h.

Member Function Documentation

template<class T >
int aims::KmeansStrategy< T >::aggregate ( const Individuals< T > &  individual)
virtual
template<class T >
void aims::KmeansStrategy< T >::analyse ( const std::vector< std::list< Individuals< T > > > &  classes)
virtual

Implements aims::ClassifStrategy< T >.

Definition at line 215 of file kmeansstrategy_d.h.

template<class T >
aims::ClassifStrategy< T > * aims::KmeansStrategy< T >::clone ( ) const
virtual

Implements aims::ClassifStrategy< T >.

Reimplemented in aims::DynamicStrategy< T >.

Definition at line 98 of file kmeansstrategy_d.h.

template<class T >
float aims::KmeansStrategy< T >::distance ( const Individuals< T > &  individual,
int  classe 
)
protectedvirtual

Implements aims::ClassifStrategy< T >.

Definition at line 312 of file kmeansstrategy_d.h.

References aims::Individuals< T >::value().

template<class T>
virtual Individuals<T> aims::KmeansStrategy< T >::getMeanValue ( int  classe)
inlinevirtual

Implements aims::ClassifStrategy< T >.

Definition at line 78 of file kmeansstrategy.h.

References aims::KmeansStrategy< T >::myMeanVector.

template<class T>
virtual std::vector< Individuals<T> > aims::KmeansStrategy< T >::getMeanVector ( )
inlinevirtual

Implements aims::ClassifStrategy< T >.

Definition at line 79 of file kmeansstrategy.h.

References aims::KmeansStrategy< T >::myMeanVector.

template<class T >
double aims::KmeansStrategy< T >::globInertia ( const std::vector< std::list< Individuals< T > > > &  classes)
virtual

Implements aims::ClassifStrategy< T >.

Definition at line 290 of file kmeansstrategy_d.h.

template<class T >
void aims::KmeansStrategy< T >::init ( std::string  initializationType,
int  nbOfClasses,
std::vector< std::list< Individuals< T > > > &  classes 
)
virtual

Implements aims::ClassifStrategy< T >.

Definition at line 105 of file kmeansstrategy_d.h.

template<class T >
double aims::KmeansStrategy< T >::iterate ( int &  nbOfIterations,
std::vector< std::list< Individuals< T > > > &  classes 
)
virtual

Implements aims::ClassifStrategy< T >.

Reimplemented in aims::DynamicStrategy< T >.

Definition at line 174 of file kmeansstrategy_d.h.

Member Data Documentation

template<class T>
int aims::KmeansStrategy< T >::myBeginIndex
protected
template<class T>
float( * aims::KmeansStrategy< T >::myDistance)(const std::vector< T > &ind1, const std::vector< T > &ind2, unsigned int beginIndex, unsigned int endIndex)
protected
template<class T>
int aims::KmeansStrategy< T >::myEndIndex
protected
template<class T>
std::vector< Individuals<T> > aims::KmeansStrategy< T >::myVarianceVector
protected

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