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

Public Member Functions

 HamerlyKMeans (const MatType &dataset, MetricType &metric)
 Construct the HamerlyKMeans 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 Hamerly's algorithm, updating the given centroids into the newCentroids matrix. More...
 

Private Attributes

arma::Col< size_t > assignments
 Assignments for each point. More...
 
const MatType & dataset
 The dataset. More...
 
size_t distanceCalculations
 Track distance calculations. More...
 
arma::vec lowerBounds
 Lower bounds for each point. More...
 
MetricType & metric
 The instantiated metric. More...
 
arma::vec minClusterDistances
 Minimum cluster distances from each cluster. More...
 
arma::vec upperBounds
 Upper bounds for each point. More...
 

Detailed Description

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

Definition at line 21 of file hamerly_kmeans.hpp.

Constructor & Destructor Documentation

◆ HamerlyKMeans()

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

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

Member Function Documentation

◆ DistanceCalculations()

template<typename MetricType , typename MatType >
size_t mlpack::kmeans::HamerlyKMeans< MetricType, MatType >::DistanceCalculations ( ) const
inline

◆ Iterate()

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

Run a single iteration of Hamerly'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

◆ assignments

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

Assignments for each point.

Definition at line 58 of file hamerly_kmeans.hpp.

◆ dataset

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

The dataset.

Definition at line 46 of file hamerly_kmeans.hpp.

◆ distanceCalculations

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

Track distance calculations.

Definition at line 61 of file hamerly_kmeans.hpp.

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

◆ lowerBounds

template<typename MetricType , typename MatType >
arma::vec mlpack::kmeans::HamerlyKMeans< MetricType, MatType >::lowerBounds
private

Lower bounds for each point.

Definition at line 56 of file hamerly_kmeans.hpp.

◆ metric

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

The instantiated metric.

Definition at line 48 of file hamerly_kmeans.hpp.

◆ minClusterDistances

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

Minimum cluster distances from each cluster.

Definition at line 51 of file hamerly_kmeans.hpp.

◆ upperBounds

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

Upper bounds for each point.

Definition at line 54 of file hamerly_kmeans.hpp.


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