mlpack  master
MaxVarianceNewCluster Class Reference

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...

Public Member Functions

 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...

 

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 26 of file max_variance_new_cluster.hpp.

Constructor & Destructor Documentation

◆ MaxVarianceNewCluster()

Default constructor required by EmptyClusterPolicy.

Definition at line 30 of file max_variance_new_cluster.hpp.

References MaxVarianceNewCluster::EmptyCluster(), and MaxVarianceNewCluster::serialize().

Member Function Documentation

◆ EmptyCluster()

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.

Template Parameters
MatTypeType of data (arma::mat or arma::sp_mat).
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. This will be modified!
clusterCountsNumber of points in each cluster.
assignmentsCluster assignments of each point.
Returns
Number of points changed.

Referenced by MaxVarianceNewCluster::MaxVarianceNewCluster().

◆ serialize()

void serialize ( Archive &  ar,
const unsigned int  version 
)

Serialize the object.

Referenced by MaxVarianceNewCluster::MaxVarianceNewCluster().


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