---
name: "mlpack_kmeans_MaxVarianceNewCluster"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_kmeans_MaxVarianceNewCluster"
---

# mlpack\_kmeans\_MaxVarianceNewCluster(3)

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.

## NAME

mlpack::kmeans::MaxVarianceNewCluster -

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.

## SYNOPSIS

### Public Member Functions

**MaxVarianceNewCluster** ()\
 *Default constructor required by EmptyClusterPolicy.*

### Static Public Member Functions

template\<typename MatType \> static size\_t **EmptyCluster** (const MatType &data, const size\_t emptyCluster, const MatType &centroids, arma::Col\< size\_t \> &clusterCounts, arma::Col\< size\_t \> &assignments)\
 *Take the point furthest from the centroid of the cluster with maximum variance to be a new cluster.*

## Detailed Description

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 36 of file max\_variance\_new\_cluster.hpp.

## Constructor & Destructor Documentation

### mlpack::kmeans::MaxVarianceNewCluster::MaxVarianceNewCluster ()` [inline]`

Default constructor required by EmptyClusterPolicy.

Definition at line 40 of file max\_variance\_new\_cluster.hpp.

## Member Function Documentation

### template\<typename MatType \> static size\_t mlpack::kmeans::MaxVarianceNewCluster::EmptyCluster (const MatType &data, const size\_temptyCluster, const MatType &centroids, arma::Col\< size\_t \> &clusterCounts, arma::Col\< size\_t \> &assignments)` [static]`

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. \
 *centroids* Centroids of each cluster (one per column). \
 *clusterCounts* Number of points in each cluster. \
 *assignments* Cluster assignments of each point.

**Returns:**

Number of points changed.

## Author

Generated automatically by Doxygen for MLPACK from the source code.
