12 #ifndef MLPACK_METHODS_KMEANS_HAMERLY_KMEANS_HPP 13 #define MLPACK_METHODS_KMEANS_HAMERLY_KMEANS_HPP 18 template<
typename MetricType,
typename MatType>
36 double Iterate(
const arma::mat& centroids,
37 arma::mat& newCentroids,
38 arma::Col<size_t>& counts);
66 #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.