Skip to content

About

Interactive step-by-step K-means clustering animation with live calculations and a complete tutorial

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K-means, made visual

An interactive, step-by-step tutorial that shows exactly how K-means clustering works—from centroid initialization through assignment, mean recalculation, and convergence.

Live demo

Open the interactive tutorial

What is included

  • A controllable K-means animation with play, pause, reset, speed, and K controls
  • Euclidean distance calculations for every point and centroid
  • Coordinate-by-coordinate centroid mean calculations
  • Live SSE (within-cluster sum of squares)
  • Selectable points for inspecting individual calculations
  • A complete tutorial covering initialization, assignment, update, convergence, the objective function, choosing K, and practical limitations
  • Responsive and keyboard-accessible design with reduced-motion support

Run locally

No build step or dependencies are required. Open index.html directly, or serve the folder with any static server:

python -m http.server 8000

Then visit http://localhost:8000.

How the animation works

The browser computes each K-means step from the displayed coordinates. The values in the plot, distance table, centroid equations, and SSE label all come from the same live algorithm state.

License

MIT

About

Interactive step-by-step K-means clustering animation with live calculations and a complete tutorial

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages