[mlpack-git] master: Fix return values. (bc3916a)
gitdub at mlpack.org
gitdub at mlpack.org
Wed Jun 8 10:05:13 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/8551a21f9821399ded164d8dbb11e453bcb33c45...e8e2ff17da5978cacf3c9a45d4aa572a4bf008e5
>---------------------------------------------------------------
commit bc3916a37e8e344df4af0669ca1787c3f77d4fab
Author: Ryan Curtin <ryan at ratml.org>
Date: Wed Jun 8 14:04:32 2016 +0000
Fix return values.
>---------------------------------------------------------------
bc3916a37e8e344df4af0669ca1787c3f77d4fab
src/mlpack/methods/kmeans/allow_empty_clusters.hpp | 1 +
src/mlpack/methods/kmeans/kill_empty_clusters.hpp | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/mlpack/methods/kmeans/allow_empty_clusters.hpp b/src/mlpack/methods/kmeans/allow_empty_clusters.hpp
index 7aacdf7..5d6be13 100644
--- a/src/mlpack/methods/kmeans/allow_empty_clusters.hpp
+++ b/src/mlpack/methods/kmeans/allow_empty_clusters.hpp
@@ -52,6 +52,7 @@ class AllowEmptyClusters
{
// Take the last iteration's centroid.
newCentroids.col(emptyCluster) = oldCentroids.col(emptyCluster);
+ return 0; // No points were changed.
}
//! Serialize the empty cluster policy (nothing to do).
diff --git a/src/mlpack/methods/kmeans/kill_empty_clusters.hpp b/src/mlpack/methods/kmeans/kill_empty_clusters.hpp
index 9b0038e..d8aa97e 100644
--- a/src/mlpack/methods/kmeans/kill_empty_clusters.hpp
+++ b/src/mlpack/methods/kmeans/kill_empty_clusters.hpp
@@ -21,7 +21,7 @@ class KillEmptyClusters
{
public:
//! Default constructor required by EmptyClusterPolicy policy.
- AllowEmptyClusters() { }
+ KillEmptyClusters() { }
/**
* This function sets an empty cluster found during k-means to all DBL_MAX
@@ -52,6 +52,7 @@ class KillEmptyClusters
{
// Kill the empty cluster.
newCentroids.col(emptyCluster).fill(DBL_MAX);
+ return 0; // No points were changed.
}
//! Serialize the empty cluster policy (nothing to do).
More information about the mlpack-git
mailing list