[mlpack-svn] r17247 - mlpack/trunk/src/mlpack/methods/kmeans
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Sun Oct 12 16:53:26 EDT 2014
Author: rcurtin
Date: Sun Oct 12 16:53:26 2014
New Revision: 17247
Log:
Better comments for the PellegMooreKMeans class.
Modified:
mlpack/trunk/src/mlpack/methods/kmeans/pelleg_moore_kmeans.hpp
Modified: mlpack/trunk/src/mlpack/methods/kmeans/pelleg_moore_kmeans.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/kmeans/pelleg_moore_kmeans.hpp (original)
+++ mlpack/trunk/src/mlpack/methods/kmeans/pelleg_moore_kmeans.hpp Sun Oct 12 16:53:26 2014
@@ -14,6 +14,25 @@
namespace mlpack {
namespace kmeans {
+/**
+ * An implementation of Pelleg-Moore's 'blacklist' algorithm for k-means
+ * clustering. This algorithm builds a kd-tree on the data points and traverses
+ * it in order to determine the closest clusters to each point.
+ *
+ * For more information on the algorithm, see
+ *
+ * @code
+ * @inproceedings{pelleg1999accelerating,
+ * title={Accelerating exact k-means algorithms with geometric reasoning},
+ * author={Pelleg, Dan and Moore, Andrew W.},
+ * booktitle={Proceedings of the Fifth ACM SIGKDD International Conference
+ * on Knowledge Discovery and Data Mining (KDD '99)},
+ * pages={277--281},
+ * year={1999},
+ * organization={ACM}
+ * }
+ * @endcode
+ */
template<typename MetricType, typename MatType>
class PellegMooreKMeans
{
@@ -40,8 +59,12 @@
arma::mat& newCentroids,
arma::Col<size_t>& counts);
+ //! Return the number of distance calculations.
size_t DistanceCalculations() const { return distanceCalculations; }
+ //! Modify the number of distance calculations.
+ size_t& DistanceCalculations() { return distanceCalculations; }
+ //! Convenience typedef for the tree.
typedef tree::BinarySpaceTree<bound::HRectBound<2, true>,
PellegMooreKMeansStatistic, MatType> TreeType;
More information about the mlpack-svn
mailing list