kmeans
k-means clustering in C++
Loading...
Searching...
No Matches
kmeans::InitializeKmeanspp< Index_, Data_, Cluster_, Float_, Matrix_ > Class Template Referencefinal

k-means++ initialization of Arthur and Vassilvitskii (2007). More...

#include <InitializeKmeanspp.hpp>

Inheritance diagram for kmeans::InitializeKmeanspp< Index_, Data_, Cluster_, Float_, Matrix_ >:
Collaboration diagram for kmeans::InitializeKmeanspp< Index_, Data_, Cluster_, Float_, Matrix_ >:

Public Member Functions

 InitializeKmeanspp (InitializeKmeansppOptions options)
 
 InitializeKmeanspp ()=default
 
InitializeKmeansppOptionsget_options ()
 
- Public Member Functions inherited from kmeans::Initialize< Index_, Data_, Cluster_, Float_, Matrix_ >
virtual Cluster_ run (const Matrix_ &data, Cluster_ num_centers, Float_ *centers) const =0
 

Detailed Description

template<typename Index_, typename Data_, typename Cluster_, typename Float_, class Matrix_ = Matrix<Index_, Data_>>
class kmeans::InitializeKmeanspp< Index_, Data_, Cluster_, Float_, Matrix_ >

k-means++ initialization of Arthur and Vassilvitskii (2007).

Selection of starting points is performed via iterations of weighted sampling, where the sampling probability for each point is proportional to the squared distance to the closest starting point that was chosen in any of the previous iterations. The aim is to obtain well-separated starting points to encourage the formation of suitable clusters.

Template Parameters
Index_Integer type of the observation indices. This should be the same as the index type of Matrix_.
Data_Numeric type of the input dataset. This should be the same as the data type of Matrix_.
Cluster_Integer type of the cluster assignments.
Float_Floating-point type of the centroids.
Matrix_Class satisfying the Matrix interface.
See also
Arthur, D. and Vassilvitskii, S. (2007). k-means++: the advantages of careful seeding. Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, 1027-1035.

Constructor & Destructor Documentation

◆ InitializeKmeanspp() [1/2]

template<typename Index_ , typename Data_ , typename Cluster_ , typename Float_ , class Matrix_ = Matrix<Index_, Data_>>
kmeans::InitializeKmeanspp< Index_, Data_, Cluster_, Float_, Matrix_ >::InitializeKmeanspp ( InitializeKmeansppOptions options)
inline
Parameters
optionsOptions for kmeans++ initialization.

◆ InitializeKmeanspp() [2/2]

template<typename Index_ , typename Data_ , typename Cluster_ , typename Float_ , class Matrix_ = Matrix<Index_, Data_>>
kmeans::InitializeKmeanspp< Index_, Data_, Cluster_, Float_, Matrix_ >::InitializeKmeanspp ( )
default

Default constructor.

Member Function Documentation

◆ get_options()

template<typename Index_ , typename Data_ , typename Cluster_ , typename Float_ , class Matrix_ = Matrix<Index_, Data_>>
InitializeKmeansppOptions & kmeans::InitializeKmeanspp< Index_, Data_, Cluster_, Float_, Matrix_ >::get_options ( )
inline
Returns
Options for kmeans++ partitioning. This can be modified prior to calling run().

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