---
name: "mlpack_kmeans_AllowEmptyClusters"
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_AllowEmptyClusters"
---

# mlpack\_kmeans\_AllowEmptyClusters(3)

Policy which allows K-Means to create empty clusters without any error being reported.

## NAME

mlpack::kmeans::AllowEmptyClusters -

Policy which allows K-Means to create empty clusters without any error being reported.

## SYNOPSIS

### Public Member Functions

**AllowEmptyClusters** ()\
 *Default constructor required by EmptyClusterPolicy policy.*

### Static Public Member Functions

template\<typename MatType \> static size\_t **EmptyCluster** (const MatType &, const size\_t, const MatType &, arma::Col\< size\_t \> &, arma::Col\< size\_t \> &)\
 *This function does nothing.*

## Detailed Description

Policy which allows K-Means to create empty clusters without any error being reported.

Definition at line 35 of file allow\_empty\_clusters.hpp.

## Constructor & Destructor Documentation

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

Default constructor required by EmptyClusterPolicy policy.

Definition at line 39 of file allow\_empty\_clusters.hpp.

## Member Function Documentation

### template\<typename MatType \> static size\_t mlpack::kmeans::AllowEmptyClusters::EmptyCluster (const MatType &, const size\_t, const MatType &, arma::Col\< size\_t \> &, arma::Col\< size\_t \> &)` [inline]`, ` [static]`

This function does nothing. It is called by K-Means when K-Means detects an empty cluster.

**Template Parameters:**

*MatType* Type of data (arma::mat or arma::spmat).

**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 (0).

Definition at line 55 of file allow\_empty\_clusters.hpp.

## Author

Generated automatically by Doxygen for MLPACK from the source code.
