12 #ifndef MLPACK_METHODS_KMEANS_ELKAN_KMEANS_HPP 13 #define MLPACK_METHODS_KMEANS_ELKAN_KMEANS_HPP 18 template<
typename MetricType,
typename MatType>
35 double Iterate(
const arma::mat& centroids,
36 arma::mat& newCentroids,
37 arma::Col<size_t>& counts);
68 #include "elkan_kmeans_impl.hpp" ElkanKMeans(const MatType &dataset, MetricType &metric)
Construct the ElkanKMeans object, which must store several sets of bounds.
size_t DistanceCalculations() const
Linear algebra utility functions, generally performed on matrices or vectors.
arma::vec upperBounds
Upper bounds on the distance between each point and its closest cluster.
arma::vec minClusterDistances
Half the distance from a cluster to its nearest cluster (s(c)).
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
Track distance calculations.
MetricType & metric
The instantiated metric.
arma::mat lowerBounds
Lower bounds on the distance between each point and each cluster.
arma::Col< size_t > assignments
Holds the index of the cluster that owns each point.
arma::mat clusterDistances
Holds intra-cluster distances.
const MatType & dataset
The dataset.