15 #ifndef MLPACK_METHODS_KMEANS_NAIVE_KMEANS_HPP 16 #define MLPACK_METHODS_KMEANS_NAIVE_KMEANS_HPP 31 template<
typename MetricType,
typename MatType>
41 NaiveKMeans(
const MatType& dataset, MetricType& metric);
53 double Iterate(
const arma::mat& centroids,
54 arma::mat& newCentroids,
55 arma::Col<size_t>& counts);
57 size_t DistanceCalculations()
const {
return distanceCalculations; }
61 const MatType& dataset;
66 size_t distanceCalculations;
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
NaiveKMeans(const MatType &dataset, MetricType &metric)
Construct the NaiveKMeans object with the given dataset and metric.
Definition: naive_kmeans_impl.hpp:26
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...
Definition: naive_kmeans_impl.hpp:35
This is an implementation of a single iteration of Lloyd's algorithm for k-means. ...
Definition: naive_kmeans.hpp:32