mlpack::kmeans Namespace Reference

K-Means clustering. More...

Classes

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

 
class  DualTreeKMeans
 An algorithm for an exact Lloyd iteration which simply uses dual-tree nearest-neighbor search to find the nearest centroid for each point in the dataset. More...

 
class  DualTreeKMeansRules
 
class  DualTreeKMeansStatistic
 
class  ElkanKMeans
 
class  HamerlyKMeans
 
class  KillEmptyClusters
 Policy which allows K-Means to "kill" empty clusters without any error being reported. More...

 
class  KMeans
 This class implements K-Means clustering, using a variety of possible implementations of Lloyd's algorithm. More...

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

 
class  NaiveKMeans
 This is an implementation of a single iteration of Lloyd's algorithm for k-means. More...

 
class  PellegMooreKMeans
 An implementation of Pelleg-Moore's 'blacklist' algorithm for k-means clustering. More...

 
class  PellegMooreKMeansRules
 The rules class for the single-tree Pelleg-Moore kd-tree traversal for k-means clustering. More...

 
class  PellegMooreKMeansStatistic
 A statistic for trees which holds the blacklist for Pelleg-Moore k-means clustering (which represents the clusters that cannot possibly own any points in a node). More...

 
class  RandomPartition
 A very simple partitioner which partitions the data randomly into the number of desired clusters. More...

 
class  RefinedStart
 A refined approach for choosing initial points for k-means clustering. More...

 
class  SampleInitialization
 

Typedefs

template
<
typename
MetricType
,
typename
MatType
>
using CoverTreeDualTreeKMeans = DualTreeKMeans< MetricType, MatType, tree::StandardCoverTree >
 A template typedef for the DualTreeKMeans algorithm with the cover tree type. More...

 
template
<
typename
MetricType
,
typename
MatType
>
using DefaultDualTreeKMeans = DualTreeKMeans< MetricType, MatType >
 A template typedef for the DualTreeKMeans algorithm with the default tree type (a kd-tree). More...

 

Functions

template
<
typename
TreeType
>
void HideChild (TreeType &node, const size_t child, const typename std::enable_if_t< !tree::TreeTraits< TreeType >::BinaryTree > *junk=0)
 Utility function for hiding children. More...

 
template
<
typename
TreeType
>
void HideChild (TreeType &node, const size_t child, const typename std::enable_if_t< tree::TreeTraits< TreeType >::BinaryTree > *junk=0)
 Utility function for hiding children. More...

 
template
<
typename
TreeType
>
void RestoreChildren (TreeType &node, const typename std::enable_if_t<!tree::TreeTraits< TreeType >::BinaryTree > *junk=0)
 Utility function for restoring children to a non-binary tree. More...

 
template
<
typename
TreeType
>
void RestoreChildren (TreeType &node, const typename std::enable_if_t< tree::TreeTraits< TreeType >::BinaryTree > *junk=0)
 Utility function for restoring children to a binary tree. More...

 

Detailed Description

K-Means clustering.

Typedef Documentation

◆ CoverTreeDualTreeKMeans

A template typedef for the DualTreeKMeans algorithm with the cover tree type.

Definition at line 170 of file dual_tree_kmeans.hpp.

◆ DefaultDualTreeKMeans

using DefaultDualTreeKMeans = DualTreeKMeans<MetricType, MatType>

A template typedef for the DualTreeKMeans algorithm with the default tree type (a kd-tree).

Definition at line 164 of file dual_tree_kmeans.hpp.

Function Documentation

◆ HideChild() [1/2]

void mlpack::kmeans::HideChild ( TreeType &  node,
const size_t  child,
const typename std::enable_if_t< !tree::TreeTraits< TreeType >::BinaryTree > *  junk = 0 
)

Utility function for hiding children.

This actually does something, and is called if the tree is not a binary tree.

Referenced by DualTreeKMeans< MetricType, MatType, TreeType >::DistanceCalculations().

◆ HideChild() [2/2]

void mlpack::kmeans::HideChild ( TreeType &  node,
const size_t  child,
const typename std::enable_if_t< tree::TreeTraits< TreeType >::BinaryTree > *  junk = 0 
)

Utility function for hiding children.

This is called when the tree is a binary tree, and does nothing, because we don't hide binary children in this way.

◆ RestoreChildren() [1/2]

void mlpack::kmeans::RestoreChildren ( TreeType &  node,
const typename std::enable_if_t<!tree::TreeTraits< TreeType >::BinaryTree > *  junk = 0 
)

Utility function for restoring children to a non-binary tree.

Referenced by DualTreeKMeans< MetricType, MatType, TreeType >::DistanceCalculations().

◆ RestoreChildren() [2/2]

void mlpack::kmeans::RestoreChildren ( TreeType &  node,
const typename std::enable_if_t< tree::TreeTraits< TreeType >::BinaryTree > *  junk = 0 
)

Utility function for restoring children to a binary tree.