kmeans
A C++ library for k-means
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).

This approach involves the selection of starting points 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 for the observation indices in the input dataset.
Data_Numeric type for the input dataset.
Cluster_Integer type for the cluster assignments.
Float_Floating-point type for the centroids.
Matrix_Class of the input data matrix. This should satisfy 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, to be modified prior to calling run().

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