mlpack
Public Types | Public Member Functions | List of all members
mlpack::kmeans::PellegMooreKMeans< MetricType, MatType > Class Template Reference

An implementation of Pelleg-Moore's 'blacklist' algorithm for k-means clustering. More...

#include <pelleg_moore_kmeans.hpp>

Public Types

typedef tree::KDTree< MetricType, PellegMooreKMeansStatistic, MatType > TreeType
 Convenience typedef for the tree.
 

Public Member Functions

 PellegMooreKMeans (const MatType &dataset, MetricType &metric)
 Construct the PellegMooreKMeans object, which must construct a tree.
 
 ~PellegMooreKMeans ()
 Delete the tree constructed by the PellegMooreKMeans object.
 
double Iterate (const arma::mat &centroids, arma::mat &newCentroids, arma::Col< size_t > &counts)
 Run a single iteration of the Pelleg-Moore blacklist algorithm, updating the given centroids into the newCentroids matrix. More...
 
size_t DistanceCalculations () const
 Return the number of distance calculations.
 
size_t & DistanceCalculations ()
 Modify the number of distance calculations.
 

Detailed Description

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

An implementation of Pelleg-Moore's 'blacklist' algorithm for k-means clustering.

This algorithm builds a kd-tree on the data points and traverses it in order to determine the closest clusters to each point.

For more information on the algorithm, see

@inproceedings{pelleg1999accelerating,
title={Accelerating exact k-means algorithms with geometric reasoning},
author={Pelleg, Dan and Moore, Andrew W.},
booktitle={Proceedings of the Fifth ACM SIGKDD International Conference
on Knowledge Discovery and Data Mining (KDD '99)},
pages={277--281},
year={1999},
organization={ACM}
}

Member Function Documentation

◆ Iterate()

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

Run a single iteration of the Pelleg-Moore blacklist algorithm, updating the given centroids into the newCentroids matrix.

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

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