mlpack
master
|
Policy which allows K-Means to "kill" empty clusters without any error being reported. More...
Public Member Functions | |
KillEmptyClusters () | |
Default constructor required by EmptyClusterPolicy policy. More... | |
template<typename Archive > | |
void | Serialize (Archive &, const unsigned int) |
Serialize the empty cluster policy (nothing to do). More... | |
Static Public Member Functions | |
template<typename MetricType , typename MatType > | |
static force_inline size_t | EmptyCluster (const MatType &, const size_t emptyCluster, const arma::mat &, arma::mat &newCentroids, arma::Col< size_t > &, MetricType &, const size_t) |
This function sets an empty cluster found during k-means to all DBL_MAX (i.e. More... | |
Policy which allows K-Means to "kill" empty clusters without any error being reported.
This means the centroids will be filled with DBL_MAX.
Definition at line 25 of file kill_empty_clusters.hpp.
|
inline |
Default constructor required by EmptyClusterPolicy policy.
Definition at line 29 of file kill_empty_clusters.hpp.
|
inlinestatic |
This function sets an empty cluster found during k-means to all DBL_MAX (i.e.
an invalid "dead" cluster).
MatType | Type of data (arma::mat or arma::spmat). |
data | Dataset on which clustering is being performed. |
emptyCluster | Index of cluster which is empty. |
oldCentroids | Centroids of each cluster (one per column) at the start of the iteration. |
newCentroids | Centroids of each cluster (one per column) at the end of the iteration. |
clusterCounts | Number of points in each cluster. |
assignments | Cluster assignments of each point. |
iteration | Number of iteration. |
Definition at line 49 of file kill_empty_clusters.hpp.
|
inline |
Serialize the empty cluster policy (nothing to do).
Definition at line 65 of file kill_empty_clusters.hpp.