[mlpack-git] master: Also use between-cluster-distance prune for points. (a09c3e3)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 12 16:04:11 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/eddd7167d69b6c88b271ef2e51d1c20e13f1acd8...70342dd8e5c17e0c164cfb8189748671e9c0dd44

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

commit a09c3e3314a00002c5e4e49ea2811cb1006d728e
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Feb 2 17:23:56 2015 -0500

    Also use between-cluster-distance prune for points.


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

a09c3e3314a00002c5e4e49ea2811cb1006d728e
 src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp b/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp
index deb98d1..d9d56f3 100644
--- a/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp
+++ b/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp
@@ -508,6 +508,16 @@ prunedPoints[index] << ", lastOwner " << lastOwners[index] << ": invalid "
         prunedCentroids.col(owner) += dataset.col(index);
         prunedCounts(owner)++;
       }
+      else if (upperBounds[index] + clusterDistances[owner] < 0.5 *
+               interclusterDistances[newFromOldCentroids[owner]])
+      {
+        prunedPoints[index] = true;
+        upperBounds[index] += clusterDistances[owner];
+        lastOwners[index] = owner;
+        lowerSecondBounds[index] -= clusterDistances[centroids.n_cols];
+        prunedCentroids.col(owner) += dataset.col(index);
+        prunedCounts(owner)++;
+      }
       else
       {
         prunedPoints[index] = false;



More information about the mlpack-git mailing list