13 #ifndef __MLPACK_METHODS_KMEANS_KILL_EMPTY_CLUSTERS_HPP 14 #define __MLPACK_METHODS_KMEANS_KILL_EMPTY_CLUSTERS_HPP 48 template<
typename MetricType,
typename MatType>
51 const size_t emptyCluster,
53 arma::mat& newCentroids,
59 newCentroids.col(emptyCluster).fill(DBL_MAX);
64 template<
typename Archive>
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Serialize(Archive &, const unsigned int)
Serialize the empty cluster policy (nothing to do).
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.
Policy which allows K-Means to "kill" empty clusters without any error being reported.
KillEmptyClusters()
Default constructor required by EmptyClusterPolicy policy.