[mlpack-git] master: Better comments for the PellegMooreKMeans class. (9d83cce)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 22:01:20 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

>---------------------------------------------------------------

commit 9d83cceca1500534348442a76c82d077d75d605c
Author: Ryan Curtin <ryan at ratml.org>
Date:   Sun Oct 12 20:53:26 2014 +0000

    Better comments for the PellegMooreKMeans class.


>---------------------------------------------------------------

9d83cceca1500534348442a76c82d077d75d605c
 src/mlpack/methods/kmeans/pelleg_moore_kmeans.hpp | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/mlpack/methods/kmeans/pelleg_moore_kmeans.hpp b/src/mlpack/methods/kmeans/pelleg_moore_kmeans.hpp
index 7a766f5..ce813b3 100644
--- a/src/mlpack/methods/kmeans/pelleg_moore_kmeans.hpp
+++ b/src/mlpack/methods/kmeans/pelleg_moore_kmeans.hpp
@@ -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 @@ class PellegMooreKMeans
                  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-git mailing list