mlpack  master

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

Public Member Functions

 AllowEmptyClusters ()
 Default constructor required by EmptyClusterPolicy policy. More...

 
template
<
typename
Archive
>
void serialize (Archive &, const unsigned int)
 Serialize the empty cluster policy (nothing to do). More...

 

Static Public Member Functions

template
<
typename
MetricType
,
typename
MatType
>
static force_inline size_t EmptyCluster (const MatType &, const size_t emptyCluster, const arma::mat &oldCentroids, arma::mat &newCentroids, arma::Col< size_t > &, MetricType &, const size_t)
 This function allows empty clusters to persist simply by leaving the empty cluster in its last position. More...

 

Detailed Description

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

Definition at line 25 of file allow_empty_clusters.hpp.

Constructor & Destructor Documentation

◆ AllowEmptyClusters()

AllowEmptyClusters ( )
inline

Default constructor required by EmptyClusterPolicy policy.

Definition at line 29 of file allow_empty_clusters.hpp.

Member Function Documentation

◆ EmptyCluster()

static force_inline size_t EmptyCluster ( const MatType &  ,
const size_t  emptyCluster,
const arma::mat &  oldCentroids,
arma::mat &  newCentroids,
arma::Col< size_t > &  ,
MetricType &  ,
const size_t   
)
inlinestatic

This function allows empty clusters to persist simply by leaving the empty cluster in its last position.

Template Parameters
MatTypeType of data (arma::mat or arma::spmat).
Parameters
dataDataset on which clustering is being performed.
emptyClusterIndex of cluster which is empty.
oldCentroidsCentroids of each cluster (one per column) at the start of the iteration.
newCentroidsCentroids of each cluster (one per column) at the end of the iteration.
clusterCountsNumber of points in each cluster.
assignmentsCluster assignments of each point.
iterationNumber of iteration.
Returns
Number of points changed (0).

Definition at line 49 of file allow_empty_clusters.hpp.

◆ serialize()

void serialize ( Archive &  ,
const unsigned  int 
)
inline

Serialize the empty cluster policy (nothing to do).

Definition at line 65 of file allow_empty_clusters.hpp.


The documentation for this class was generated from the following file: