14 #ifndef MLPACK_METHODS_KMEANS_NAIVE_KMEANS_HPP 15 #define MLPACK_METHODS_KMEANS_NAIVE_KMEANS_HPP 29 template<
typename MetricType,
typename MatType>
39 NaiveKMeans(
const MatType& dataset, MetricType& metric);
51 double Iterate(
const arma::mat& centroids,
52 arma::mat& newCentroids,
53 arma::Col<size_t>& counts);
59 const MatType& dataset;
64 size_t distanceCalculations;
71 #include "naive_kmeans_impl.hpp" NaiveKMeans(const MatType &dataset, MetricType &metric)
Construct the NaiveKMeans object with the given dataset and metric.
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 the Lloyd algorithm, updating the given centroids into the newCentroids mat...
size_t DistanceCalculations() const
This is an implementation of a single iteration of Lloyd's algorithm for k-means. ...