16 #ifndef __MLPACK_METHODS_KMEANS_MAX_VARIANCE_NEW_CLUSTER_HPP
17 #define __MLPACK_METHODS_KMEANS_MAX_VARIANCE_NEW_CLUSTER_HPP
50 template<
typename MetricType,
typename MatType>
52 const size_t emptyCluster,
53 const arma::mat& oldCentroids,
54 arma::mat& newCentroids,
55 arma::Col<size_t>& clusterCounts,
60 template<
typename Archive>
61 void Serialize(Archive& ar,
const unsigned int version);
72 template<
typename MetricType,
typename MatType>
74 const arma::mat& oldCentroids,
75 arma::Col<size_t>& clusterCounts,
83 #include "max_variance_new_cluster_impl.hpp"
size_t iteration
Index of iteration for which variance is cached.
Linear algebra utility functions, generally performed on matrices or vectors.
MaxVarianceNewCluster()
Default constructor required by EmptyClusterPolicy.
When an empty cluster is detected, this class takes the point furthest from the centroid of the clust...
void Serialize(Archive &ar, const unsigned int version)
Serialize the object.
size_t EmptyCluster(const MatType &data, const size_t emptyCluster, const arma::mat &oldCentroids, arma::mat &newCentroids, arma::Col< size_t > &clusterCounts, MetricType &metric, const size_t iteration)
Take the point furthest from the centroid of the cluster with maximum variance to be a new cluster...
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
void Precalculate(const MatType &data, const arma::mat &oldCentroids, arma::Col< size_t > &clusterCounts, MetricType &metric)
Called when we are on a new iteration.
arma::Row< size_t > assignments
Cached assignments for each point.
arma::vec variances
Cached variances for each cluster.