BICO  1.1
 All Classes Namespaces Files Functions Variables Typedefs Pages
CluE::KMeansEvaluator< T > Class Template Reference

Calculates the k-means weight. More...

#include <kmeansevaluator.h>

Inheritance diagram for CluE::KMeansEvaluator< T >:
Inheritance graph
Collaboration diagram for CluE::KMeansEvaluator< T >:
Collaboration graph

Public Member Functions

 KMeansEvaluator (DissimilarityMeasure< T > const *measure=0)
 Instantiates KMeansEvaluator, optionally with a DissimilarityMeasure to use when calculation the maximum diameter. More...
 
 KMeansEvaluator (const KMeansEvaluator< T > &)
 
KMeansEvaluator< T > & operator= (const KMeansEvaluator< T > &)
 
virtual ~KMeansEvaluator ()
 
virtual void setMeasure (DissimilarityMeasure< T > const *measure)
 Sets the DissimilarityMeasure used when calculating the maximum diameter. More...
 
void setWeightModifier (WeightModifier< T > *wm)
 
virtual double proxycost (std::vector< T * > const &points, std::vector< T > const &proxies) const
 Assigns all points to a proxy and calculates the k-means weight of the resulting clustering. More...
 
virtual double proxycost (std::vector< T * > const &points, std::vector< T * > const &proxies) const
 
virtual double proxycost (std::vector< T * > const &points, ProxyProvider< T > const &proxySource, unsigned int solutionIndex) const
 Assigns all points to a proxy (provided by proxySource) and calculates the k-means weight of the resulting clustering. More...
 
virtual double proxycost (std::vector< T * > const &points, DiscreteProxyProvider< T > const &proxySource, unsigned int solutionIndex) const
 
virtual double proxycost (std::vector< T * > const &points, std::vector< T > const &proxies, unsigned int index) const
 Assigns all points to a proxy and calculates the k-means weight of the cluster[index]. More...
 
virtual double proxycost (std::vector< T * > const &points, std::vector< T * > const &proxies, unsigned int index) const
 
virtual double proxycost (std::vector< T * > const &points, ProxyProvider< T > const &proxySource, unsigned int solutionIndex, unsigned int proxyIndex) const
 Assigns all points to a proxy (provided by proxySource) and calculates the k-means weight of the cluster[index]. More...
 
virtual double proxycost (std::vector< T * > const &points, DiscreteProxyProvider< T > const &proxySource, unsigned int solutionIndex, unsigned int proxyIndex) const
 
virtual double combinedcost (std::vector< std::vector< T * > > const &clusters, std::vector< T > const &proxies) const
 Calculates the k-means weight of a given clustering. More...
 
virtual double combinedcost (std::vector< std::vector< T * > > const &clusters, std::vector< T * > const &proxies) const
 
virtual double combinedcost (PartitionProvider< T > const &clusteringSource, ProxyProvider< T > const &proxySource, unsigned int solutionIndex) const
 Calculates the k-means weight of a given clustering (provided by clusteringSource and proxySource). More...
 
virtual double combinedcost (PartitionProvider< T > const &clusteringSource, DiscreteProxyProvider< T > const &proxySource, unsigned int solutionIndex) const
 
virtual double combinedcost (std::vector< T * > const &cluster, T const &proxy) const
 Calculates the k-means weight of a given proxy and the corresponding points. More...
 
virtual double combinedcost (PartitionProvider< T > const &clusteringSource, ProxyProvider< T > const &proxySource, unsigned int solutionIndex, unsigned int proxyIndex) const
 Calculates the k-means weight of a given proxy (provided by proxySource) and the corresponding points (provided by clusteringSource). More...
 
virtual double combinedcost (PartitionProvider< T > const &clusteringSource, DiscreteProxyProvider< T > const &proxySource, unsigned int solutionIndex, unsigned int proxyIndex) const
 
- Public Member Functions inherited from CluE::ProxyEvaluation< T >
virtual ~ProxyEvaluation ()
 
- Public Member Functions inherited from CluE::Evaluation
virtual ~Evaluation ()
 
- Public Member Functions inherited from CluE::CombinedEvaluation< T >
virtual ~CombinedEvaluation ()
 
virtual double combinedcost (std::vector< T * > const &partition, T const *const proxy) const
 

Protected Member Functions

std::vector< double > proxycostGeneric (std::vector< T * > const &points, std::vector< T > const &proxies) const
 Provides a k-means weight result per cluster (may be added, chosen from, ...). More...
 
std::vector< double > proxycostGeneric (std::vector< T * > const &points, std::vector< T * > const &proxies) const
 

Private Attributes

DissimilarityMeasure< T > * measure
 
WeightModifier< T > * weightModifier
 

Detailed Description

template<typename T>
class CluE::KMeansEvaluator< T >

Calculates the k-means weight.

Note
Arguments named firstSecondThird may be shortened fST in formulas.
The distance measure is referred to as d(x,y) in formulas.

Definition at line 21 of file kmeansevaluator.h.

Constructor & Destructor Documentation

template<typename T >
CluE::KMeansEvaluator< T >::KMeansEvaluator ( DissimilarityMeasure< T > const *  measure = 0)

Instantiates KMeansEvaluator, optionally with a DissimilarityMeasure to use when calculation the maximum diameter.

Parameters
measureOptional. Nevertheless, you have to set a DissimilarityMeasure before using this class.
See also
setMeasure

Definition at line 151 of file kmeansevaluator.h.

template<typename T >
CluE::KMeansEvaluator< T >::KMeansEvaluator ( const KMeansEvaluator< T > &  kme)

Definition at line 157 of file kmeansevaluator.h.

template<typename T >
CluE::KMeansEvaluator< T >::~KMeansEvaluator ( )
virtual

Definition at line 178 of file kmeansevaluator.h.

Member Function Documentation

template<typename T >
KMeansEvaluator< T > & CluE::KMeansEvaluator< T >::operator= ( const KMeansEvaluator< T > &  kme)

Definition at line 162 of file kmeansevaluator.h.

template<typename T >
void CluE::KMeansEvaluator< T >::setMeasure ( DissimilarityMeasure< T > const *  measure)
virtual

Sets the DissimilarityMeasure used when calculating the maximum diameter.

Implements CluE::MeasureSetter< T >.

Definition at line 249 of file kmeansevaluator.h.

template<typename T >
void CluE::KMeansEvaluator< T >::setWeightModifier ( WeightModifier< T > *  wm)

Definition at line 418 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::proxycost ( std::vector< T * > const &  points,
std::vector< T > const &  proxies 
) const
virtual

Assigns all points to a proxy and calculates the k-means weight of the resulting clustering.

Returns

\[ \sum{ \{d(p, \mathrm{proxy}(x)) \: | \: p \in \mathtt{points} \}} \]

where $ \mathrm{proxy}(x) $ assigns the nearest proxy from proxies to x.

Implements CluE::ProxyEvaluation< T >.

Definition at line 188 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::proxycost ( std::vector< T * > const &  points,
std::vector< T * > const &  proxies 
) const
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Implements CluE::ProxyEvaluation< T >.

Definition at line 202 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::proxycost ( std::vector< T * > const &  points,
ProxyProvider< T > const &  proxySource,
unsigned int  solutionIndex 
) const
virtual

Assigns all points to a proxy (provided by proxySource) and calculates the k-means weight of the resulting clustering.

Returns

\[ \sum{ \{d(p, \mathrm{proxy}(x)) \: | \: p \in \mathtt{points} \}} \]

where $ \mathrm{proxy}(x) $ assigns the nearest proxy from $ \mathtt{pS}_\mathtt{sI} $ to x.

Implements CluE::ProxyEvaluation< T >.

Definition at line 216 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::proxycost ( std::vector< T * > const &  points,
DiscreteProxyProvider< T > const &  proxySource,
unsigned int  solutionIndex 
) const
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Implements CluE::ProxyEvaluation< T >.

Definition at line 221 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::proxycost ( std::vector< T * > const &  points,
std::vector< T > const &  proxies,
unsigned int  index 
) const
virtual

Assigns all points to a proxy and calculates the k-means weight of the cluster[index].

Returns

\[ \sum{ \{d(p, \mathrm{proxy}(x)) \: | \: p \in \mathtt{points}, \mathrm{proxy}(x)=\mathtt{proxies}_\mathtt{index} \} } \]

where $ \mathrm{proxy}(x) $ assigns the nearest proxy from proxies to x.

Implements CluE::ProxyEvaluation< T >.

Definition at line 227 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::proxycost ( std::vector< T * > const &  points,
std::vector< T * > const &  proxies,
unsigned int  index 
) const
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Implements CluE::ProxyEvaluation< T >.

Definition at line 233 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::proxycost ( std::vector< T * > const &  points,
ProxyProvider< T > const &  proxySource,
unsigned int  solutionIndex,
unsigned int  proxyIndex 
) const
virtual

Assigns all points to a proxy (provided by proxySource) and calculates the k-means weight of the cluster[index].

Returns

\[ \sum{ \{d(p, \mathrm{proxy}(x)) \: | \: p \in \mathtt{points}, \mathrm{proxy}(x)=\mathtt{pS}_{\mathtt{sI}_\mathtt{pI}} \} } \]

where $ \mathrm{proxy}(x) $ assigns the nearest proxy from $ \mathtt{pS}_\mathtt{sI} $ to x.

Implements CluE::ProxyEvaluation< T >.

Definition at line 239 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::proxycost ( std::vector< T * > const &  points,
DiscreteProxyProvider< T > const &  proxySource,
unsigned int  solutionIndex,
unsigned int  proxyIndex 
) const
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Implements CluE::ProxyEvaluation< T >.

Definition at line 244 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::combinedcost ( std::vector< std::vector< T * > > const &  clusters,
std::vector< T > const &  proxies 
) const
virtual

Calculates the k-means weight of a given clustering.

Returns

\[ \sum{ \{ d(p_{i,j}, \mathtt{proxies}_i) \: | \: p_{i,j} \in \mathtt{clusters}_i \} } \]

Implements CluE::CombinedEvaluation< T >.

Definition at line 324 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::combinedcost ( std::vector< std::vector< T * > > const &  clusters,
std::vector< T * > const &  proxies 
) const
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Implements CluE::CombinedEvaluation< T >.

Definition at line 353 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::combinedcost ( PartitionProvider< T > const &  clusteringSource,
ProxyProvider< T > const &  proxySource,
unsigned int  solutionIndex 
) const
virtual

Calculates the k-means weight of a given clustering (provided by clusteringSource and proxySource).

Returns

\[ \sum{ \{ d(p_{i,j}, \mathtt{pS}_{\mathtt{sI}_i}) \: | \: p_{i,j} \in \mathtt{cS}_{\mathtt{sI}_i} \} } \]

Implements CluE::CombinedEvaluation< T >.

Definition at line 382 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::combinedcost ( PartitionProvider< T > const &  clusteringSource,
DiscreteProxyProvider< T > const &  proxySource,
unsigned int  solutionIndex 
) const
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Implements CluE::CombinedEvaluation< T >.

Definition at line 387 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::combinedcost ( std::vector< T * > const &  cluster,
T const &  proxy 
) const
virtual

Calculates the k-means weight of a given proxy and the corresponding points.

Returns

\[ \sum{ \{ d(p, \mathtt{proxy}) \: | \: p \in \mathtt{cluster} \} } \]

Implements CluE::CombinedEvaluation< T >.

Definition at line 392 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::combinedcost ( PartitionProvider< T > const &  clusteringSource,
ProxyProvider< T > const &  proxySource,
unsigned int  solutionIndex,
unsigned int  proxyIndex 
) const
virtual

Calculates the k-means weight of a given proxy (provided by proxySource) and the corresponding points (provided by clusteringSource).

Returns

\[ \sum{ \{ d(p, \mathtt{pS}_{\mathtt{sI}_\mathtt{pI}}) \: | \: p \in \mathtt{cS}_{\mathtt{sI}_\mathtt{pI}} \} } \]

Implements CluE::CombinedEvaluation< T >.

Definition at line 408 of file kmeansevaluator.h.

template<typename T >
double CluE::KMeansEvaluator< T >::combinedcost ( PartitionProvider< T > const &  clusteringSource,
DiscreteProxyProvider< T > const &  proxySource,
unsigned int  solutionIndex,
unsigned int  proxyIndex 
) const
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Implements CluE::CombinedEvaluation< T >.

Definition at line 413 of file kmeansevaluator.h.

template<typename T >
std::vector< double > CluE::KMeansEvaluator< T >::proxycostGeneric ( std::vector< T * > const &  points,
std::vector< T > const &  proxies 
) const
protected

Provides a k-means weight result per cluster (may be added, chosen from, ...).

Definition at line 259 of file kmeansevaluator.h.

template<typename T >
std::vector< double > CluE::KMeansEvaluator< T >::proxycostGeneric ( std::vector< T * > const &  points,
std::vector< T * > const &  proxies 
) const
protected

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 291 of file kmeansevaluator.h.

Member Data Documentation

template<typename T>
DissimilarityMeasure<T>* CluE::KMeansEvaluator< T >::measure
private

Definition at line 147 of file kmeansevaluator.h.

template<typename T>
WeightModifier<T>* CluE::KMeansEvaluator< T >::weightModifier
private

Definition at line 148 of file kmeansevaluator.h.


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