MLPACK  1.0.10
allow_empty_clusters.hpp
Go to the documentation of this file.
1 
23 #ifndef __MLPACK_METHODS_KMEANS_ALLOW_EMPTY_CLUSTERS_HPP
24 #define __MLPACK_METHODS_KMEANS_ALLOW_EMPTY_CLUSTERS_HPP
25 
26 #include <mlpack/core.hpp>
27 
28 namespace mlpack {
29 namespace kmeans {
30 
36 {
37  public:
40 
54  template<typename MatType>
55  static size_t EmptyCluster(const MatType& /* data */,
56  const size_t /* emptyCluster */,
57  const MatType& /* centroids */,
58  arma::Col<size_t>& /* clusterCounts */,
59  arma::Col<size_t>& /* assignments */)
60  {
61  // Empty clusters are okay! Do nothing.
62  return 0;
63  }
64 };
65 
66 }; // namespace kmeans
67 }; // namespace mlpack
68 
69 #endif
static size_t EmptyCluster(const MatType &, const size_t, const MatType &, arma::Col< size_t > &, arma::Col< size_t > &)
This function does nothing.
AllowEmptyClusters()
Default constructor required by EmptyClusterPolicy policy.
Policy which allows K-Means to create empty clusters without any error being reported.