mlpack  master
Public Member Functions | Private Attributes | List of all members
mlpack::kmeans::ElkanKMeans< MetricType, MatType > Class Template Reference

Public Member Functions

 ElkanKMeans (const MatType &dataset, MetricType &metric)
 Construct the ElkanKMeans object, which must store several sets of bounds. More...
 
size_t DistanceCalculations () const
 
double Iterate (const arma::mat &centroids, arma::mat &newCentroids, arma::Col< size_t > &counts)
 Run a single iteration of Elkan's algorithm, updating the given centroids into the newCentroids matrix. More...
 

Private Attributes

arma::Col< size_t > assignments
 Holds the index of the cluster that owns each point. More...
 
arma::mat clusterDistances
 Holds intra-cluster distances. More...
 
const MatType & dataset
 The dataset. More...
 
size_t distanceCalculations
 Track distance calculations. More...
 
arma::mat lowerBounds
 Lower bounds on the distance between each point and each cluster. More...
 
MetricType & metric
 The instantiated metric. More...
 
arma::vec minClusterDistances
 Half the distance from a cluster to its nearest cluster (s(c)). More...
 
arma::vec upperBounds
 Upper bounds on the distance between each point and its closest cluster. More...
 

Detailed Description

template<typename MetricType, typename MatType>
class mlpack::kmeans::ElkanKMeans< MetricType, MatType >

Definition at line 19 of file elkan_kmeans.hpp.

Constructor & Destructor Documentation

template<typename MetricType , typename MatType >
mlpack::kmeans::ElkanKMeans< MetricType, MatType >::ElkanKMeans ( const MatType &  dataset,
MetricType &  metric 
)

Construct the ElkanKMeans object, which must store several sets of bounds.

Member Function Documentation

template<typename MetricType , typename MatType >
size_t mlpack::kmeans::ElkanKMeans< MetricType, MatType >::DistanceCalculations ( ) const
inline
template<typename MetricType , typename MatType >
double mlpack::kmeans::ElkanKMeans< MetricType, MatType >::Iterate ( const arma::mat &  centroids,
arma::mat &  newCentroids,
arma::Col< size_t > &  counts 
)

Run a single iteration of Elkan's algorithm, updating the given centroids into the newCentroids matrix.

Parameters
centroidsCurrent cluster centroids.
newCentroidsNew cluster centroids.
countsCurrent counts, to be overwritten with new counts.

Member Data Documentation

template<typename MetricType , typename MatType >
arma::Col<size_t> mlpack::kmeans::ElkanKMeans< MetricType, MatType >::assignments
private

Holds the index of the cluster that owns each point.

Definition at line 53 of file elkan_kmeans.hpp.

template<typename MetricType , typename MatType >
arma::mat mlpack::kmeans::ElkanKMeans< MetricType, MatType >::clusterDistances
private

Holds intra-cluster distances.

Definition at line 48 of file elkan_kmeans.hpp.

template<typename MetricType , typename MatType >
const MatType& mlpack::kmeans::ElkanKMeans< MetricType, MatType >::dataset
private

The dataset.

Definition at line 43 of file elkan_kmeans.hpp.

template<typename MetricType , typename MatType >
size_t mlpack::kmeans::ElkanKMeans< MetricType, MatType >::distanceCalculations
private

Track distance calculations.

Definition at line 61 of file elkan_kmeans.hpp.

Referenced by mlpack::kmeans::ElkanKMeans< MetricType, MatType >::DistanceCalculations().

template<typename MetricType , typename MatType >
arma::mat mlpack::kmeans::ElkanKMeans< MetricType, MatType >::lowerBounds
private

Lower bounds on the distance between each point and each cluster.

Definition at line 58 of file elkan_kmeans.hpp.

template<typename MetricType , typename MatType >
MetricType& mlpack::kmeans::ElkanKMeans< MetricType, MatType >::metric
private

The instantiated metric.

Definition at line 45 of file elkan_kmeans.hpp.

template<typename MetricType , typename MatType >
arma::vec mlpack::kmeans::ElkanKMeans< MetricType, MatType >::minClusterDistances
private

Half the distance from a cluster to its nearest cluster (s(c)).

Definition at line 50 of file elkan_kmeans.hpp.

template<typename MetricType , typename MatType >
arma::vec mlpack::kmeans::ElkanKMeans< MetricType, MatType >::upperBounds
private

Upper bounds on the distance between each point and its closest cluster.

Definition at line 56 of file elkan_kmeans.hpp.


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