Checklist NOAI Singapore 2025 Final · Task 2
K-Means Clustering
Implement k-means clustering with given initial centroids and return the final centroids.
The task
Question 2 (25 marks) asks for euclidean_distance and k_means_clustering(points, k, initial_centroids, max_iterations): assign points to the nearest centroid, update centroids as cluster means (handling empty clusters), stop on convergence or after max_iterations, and return the centroids rounded to four decimals. The fixed example uses six 2-D points, k = 2 and initial centroids (2, 2) and (10, 1).
Abridged by SOTA from the official materials. The official statement has the exact rules, and it wins wherever this summary differs.
At a glance
- You get
- A list of point tuples, k, initial centroids and
max_iterations. - You submit
- A list of final centroids rounded to four decimals.
- Rules
- Python 3.9 standard library and NumPy only.
- Format
- NOAI 2025 competition day, 8 March 2025, NTU College of Computing and Data Science; 2.5 hours; Section 1 (MCQs) and Section 2 (three programming questions, 80 marks).