Visible to Intel only — GUID: GUID-CE6C9714-6F1D-4F3A-8F74-5E5195EA7D92
Visible to Intel only — GUID: GUID-CE6C9714-6F1D-4F3A-8F74-5E5195EA7D92
K-Means initialization
The K-Means initialization algorithm receives n feature vectors as input and chooses k initial centroids. After initialization, K-Means algorithm uses the initialization result to partition input data into k clusters.
Operation |
Computational methods |
Programming Interface |
||
Mathematical formulation
Computing
Given the training set of p-dimensional feature vectors and a positive integer k, the problem is to find a set of p-dimensional initial centroids.
Computing method: dense
The method chooses first k feature vectors from the training set X.
Programming Interface
Refer to API Reference: K-Means initialization.
Usage example
Computing
table run_compute(const table& data) { const auto kmeans_desc = kmeans_init::descriptor<float, kmeans_init::method::dense>{} .set_cluster_count(10) const auto result = compute(kmeans_desc, data); print_table("centroids", result.get_centroids()); return result.get_centroids(); }
Examples
oneAPI DPC++
Batch Processing:
dpc_kmeans_init_dense.cpp
oneAPI C++
Batch Processing:
cpp_kmeans_init_dense.cpp