Back to problems

Implement K-Means in NumPy or PyTorch

Algorithm · Apple · Medium

Build K-Means with NumPy or PyTorch Problem Overview In this machine-learning coding exercise, implement K-Means clustering yourself using either NumPy or PyTorch. The expected solution should demonstrate: Fluency with array or tensor operations such as keepdim, unsqueeze, reshaping, and dimension conventions. A broadcast-based, vectorized approach. Do not use naive Python loops across the data points or centroids for the expensive work. Correct execution of Lloyd's…

Checking your access…