12 #ifndef MLPACK_METHODS_KMEANS_ELKAN_KMEANS_HPP 13 #define MLPACK_METHODS_KMEANS_ELKAN_KMEANS_HPP 18 template<
typename MetricType,
typename MatType>
25 ElkanKMeans(
const MatType& dataset, MetricType& metric);
35 double Iterate(
const arma::mat& centroids,
36 arma::mat& newCentroids,
37 arma::Col<size_t>& counts);
43 const MatType& dataset;
48 arma::mat clusterDistances;
50 arma::vec minClusterDistances;
53 arma::Col<size_t> assignments;
56 arma::vec upperBounds;
58 arma::mat lowerBounds;
61 size_t distanceCalculations;
68 #include "elkan_kmeans_impl.hpp" Linear algebra utility functions, generally performed on matrices or vectors.
double Iterate(const arma::mat ¢roids, arma::mat &newCentroids, arma::Col< size_t > &counts)
Run a single iteration of Elkan's algorithm, updating the given centroids into the newCentroids matri...
size_t DistanceCalculations() const
ElkanKMeans(const MatType &dataset, MetricType &metric)
Construct the ElkanKMeans object, which must store several sets of bounds.