Back to problems

Hand-Written K-Means

Algorithm · Microsoft · Medium

Requirements For an input X: list[list[float]] with dimensions (N, D) and an integer K, produce labels: list[int] containing N cluster IDs along with centroids: list[list[float]] sized (K, D). You may use plain Python, NumPy, or PyTorch, whichever you prefer. Interview evaluation generally emphasizes a sound algorithm outline and an accurate complexity discussion rather than requiring executable code. Use the usual version of the algorithm: If there is additional time,…

Checking your access…