mlpack
|
This class implements the k-means++ initialization, as described in the following paper: More...
#include <kmeans_plus_plus_initialization.hpp>
Public Member Functions | |
KMeansPlusPlusInitialization () | |
Empty constructor, required by the InitialPartitionPolicy type definition. | |
Static Public Member Functions | |
template<typename MatType > | |
static void | Cluster (const MatType &data, const size_t clusters, arma::mat ¢roids) |
Initialize the centroids matrix by randomly sampling points from the data matrix. More... | |
This class implements the k-means++ initialization, as described in the following paper:
In accordance with mlpack's InitialPartitionPolicy template type, we only need to implement a constructor and a method to compute the initial centroids.
|
inlinestatic |
Initialize the centroids matrix by randomly sampling points from the data matrix.
data | Dataset. |
clusters | Number of clusters. |
centroids | Matrix to put initial centroids into. |