Code K-Means


You are given a dataset \(X (n,m)\), n data points each having m columns. You are also given a number \(K\).
Write a code to partition this data into \(K\) clusters such that WCSS (within clusters squared sum) metrics is minimized.


Inputs
  • \( X \) (independent variables): \((n , m )\) List
  • \(K\) : Number of Cluster
Output
  • list of cluster_id of each data point



Code Output