In this segment, we walk through a high-level structure for implementing k-means clustering from scratch, focusing on clarity, modularity, and real-time reasoning. The emphasis is not on memorizing code, but on understanding the logic and being able to build it confidently.
__init__
method to store core parameters like the number of clusters (k) and max iterati