14 #ifndef __MLPACK_METHODS_KMEANS_HAMERLY_KMEANS_HPP
15 #define __MLPACK_METHODS_KMEANS_HAMERLY_KMEANS_HPP
20 template<
typename MetricType,
typename MatType>
38 double Iterate(
const arma::mat& centroids,
39 arma::mat& newCentroids,
40 arma::Col<size_t>& counts);
68 #include "hamerly_kmeans_impl.hpp"
const MatType & dataset
The dataset.
arma::vec minClusterDistances
Minimum cluster distances from each cluster.
size_t DistanceCalculations() const
Linear algebra utility functions, generally performed on matrices or vectors.
size_t distanceCalculations
Track distance calculations.
arma::vec upperBounds
Upper bounds for each point.
MetricType & metric
The instantiated metric.
HamerlyKMeans(const MatType &dataset, MetricType &metric)
Construct the HamerlyKMeans object, which must store several sets of bounds.
arma::Col< size_t > assignments
Assignments for each point.
double Iterate(const arma::mat ¢roids, arma::mat &newCentroids, arma::Col< size_t > &counts)
Run a single iteration of Hamerly's algorithm, updating the given centroids into the newCentroids mat...
arma::vec lowerBounds
Lower bounds for each point.