mlpack
|
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 ¢roids, 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. | |
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
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.
centroids | Current cluster centroids. |
newCentroids | New cluster centroids. |
counts | Current counts, to be overwritten with new counts. |