Module 3

Dimensionality Reduction and Clustering

Author

Yike Zhang

Published

September 18, 2025

Class Activities

Week 5

Recap

Link to Google Form

Hands-on Practice

Release Soon

Week 6

Recap

Link to Google Form

Hands-on Practice

Release Soon

Example: Interactive K-Means Clustering Plot

Below is an interactive k-means clustering visualization with animated iterations and a Voronoi overlay. You can adjust the number of clusters using the slider. The data points are randomly initialized from a CSV file hosted on GitHub. The visualization updates the clusters and centroids over 10 iterations.

You pick the number of clusters k, then the plot:

  • randomly seeds k centroids,
  • repeatedly assigns each point to the nearest centroid,
  • updates each centroid to the mean of its assigned points,
  • animates those changes over ~10 iterations,
  • shows a Voronoi partition (the colored regions), the data points, and the centroid markers.