When an empty cluster is detected, this class takes the point furthest from the centroid of the cluster with maximum variance as a new cluster.
More...
|
| | MaxVarianceNewCluster () |
| | Default constructor required by EmptyClusterPolicy. More...
|
| |
| template<typename MetricType , typename MatType > |
| 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. More...
|
| |
| template<typename Archive > |
| void | Serialize (Archive &ar, const unsigned int version) |
| | Serialize the object. More...
|
| |
|
| template<typename MetricType , typename MatType > |
| void | Precalculate (const MatType &data, const arma::mat &oldCentroids, arma::Col< size_t > &clusterCounts, MetricType &metric) |
| | Called when we are on a new iteration. More...
|
| |
When an empty cluster is detected, this class takes the point furthest from the centroid of the cluster with maximum variance as a new cluster.
Definition at line 28 of file max_variance_new_cluster.hpp.
| mlpack::kmeans::MaxVarianceNewCluster::MaxVarianceNewCluster |
( |
| ) |
|
|
inline |
template<typename MetricType , typename MatType >
| size_t mlpack::kmeans::MaxVarianceNewCluster::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.
- Template Parameters
-
| MatType | Type of data (arma::mat or arma::sp_mat). |
- Parameters
-
| 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. This will be modified! |
| clusterCounts | Number of points in each cluster. |
| assignments | Cluster assignments of each point. |
- Returns
- Number of points changed.
template<typename MetricType , typename MatType >
| void mlpack::kmeans::MaxVarianceNewCluster::Precalculate |
( |
const MatType & |
data, |
|
|
const arma::mat & |
oldCentroids, |
|
|
arma::Col< size_t > & |
clusterCounts, |
|
|
MetricType & |
metric |
|
) |
| |
|
private |
Called when we are on a new iteration.
template<typename Archive >
| void mlpack::kmeans::MaxVarianceNewCluster::Serialize |
( |
Archive & |
ar, |
|
|
const unsigned int |
version |
|
) |
| |
| arma::Row<size_t> mlpack::kmeans::MaxVarianceNewCluster::assignments |
|
private |
| size_t mlpack::kmeans::MaxVarianceNewCluster::iteration |
|
private |
| arma::vec mlpack::kmeans::MaxVarianceNewCluster::variances |
|
private |
The documentation for this class was generated from the following file: