14 #ifndef MLPACK_METHODS_KMEANS_PELLEG_MOORE_KMEANS_RULES_HPP 15 #define MLPACK_METHODS_KMEANS_PELLEG_MOORE_KMEANS_RULES_HPP 32 template<
typename MetricType,
typename TreeType>
47 const arma::mat& centroids,
48 arma::mat& newCentroids,
49 arma::Col<size_t>& counts,
59 double BaseCase(
const size_t queryIndex,
const size_t referenceIndex);
69 double Score(
const size_t queryIndex, TreeType& referenceNode);
79 double Rescore(
const size_t queryIndex,
80 TreeType& referenceNode,
81 const double oldScore);
90 const typename TreeType::Mat& dataset;
92 const arma::mat& centroids;
94 arma::mat& newCentroids;
96 arma::Col<size_t>& counts;
101 size_t distanceCalculations;
108 #include "pelleg_moore_kmeans_rules_impl.hpp" Linear algebra utility functions, generally performed on matrices or vectors.
size_t DistanceCalculations() const
Get the number of distance calculations that have been performed.
double BaseCase(const size_t queryIndex, const size_t referenceIndex)
The BaseCase() function for this single-tree algorithm does nothing.
double Score(const size_t queryIndex, TreeType &referenceNode)
Determine if a cluster can be pruned, and if not, perform point-to-cluster comparisons.
size_t & DistanceCalculations()
Modify the number of distance calculations that have been performed.
PellegMooreKMeansRules(const typename TreeType::Mat &dataset, const arma::mat ¢roids, arma::mat &newCentroids, arma::Col< size_t > &counts, MetricType &metric)
Create the PellegMooreKMeansRules object.
double Rescore(const size_t queryIndex, TreeType &referenceNode, const double oldScore)
Rescore to determine if a node can be pruned.
The rules class for the single-tree Pelleg-Moore kd-tree traversal for k-means clustering.