Algorithm · Microsoft · Hard
Build a production-grade k-means clustering routine from first principles. The required callable is: kmeans(X, k, init="k-means++", max_iter=300, tol=1e-4, random_state=0, n_init=10, standardize=False) It receives a real-valued matrix X of shape $$n \times d$$ and returns (centers, labels, inertia). centers has shape $$k \times d$$, labels is an integer vector of length $$n$$, and inertia is the total squared Euclidean distance from each row of X to its assigned center. Do…
Checking your access…