14#ifndef MLPACK_METHODS_KMEANS_MAX_VARIANCE_NEW_CLUSTER_HPP
15#define MLPACK_METHODS_KMEANS_MAX_VARIANCE_NEW_CLUSTER_HPP
48 template<
typename MetricType,
typename MatType>
50 const size_t emptyCluster,
51 const arma::mat& oldCentroids,
52 arma::mat& newCentroids,
53 arma::Col<size_t>& clusterCounts,
55 const size_t iteration);
58 template<
typename Archive>
59 void serialize(Archive& ar,
const unsigned int version);
67 arma::Row<size_t> assignments;
70 template<
typename MetricType,
typename MatType>
71 void Precalculate(
const MatType& data,
72 const arma::mat& oldCentroids,
73 arma::Col<size_t>& clusterCounts,
81#include "max_variance_new_cluster_impl.hpp"
When an empty cluster is detected, this class takes the point furthest from the centroid of the clust...
void 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.
void serialize(Archive &ar, const unsigned int version)
Serialize the object.
MaxVarianceNewCluster()
Default constructor required by EmptyClusterPolicy.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.