/K-Means

K-Means implementation in javascript es6

Primary LanguageJavaScript

K-Means implementation in javascript es6

Here are the steps:

  1. Initialization: Create N nodes (circle) and randomly put initial K cluster (cross).
  2. Assignment step: Assign each node (circle) to the nearest cluster (cross).
  3. Update step: Each cluster (cross) move to the centroid of its nodes.
  4. Go to step 2.

Run

For running this project, just download the repo and open index.html in your browser. No npm install needed, no node involved.

This project make use of bootstrap from CDN for theming and babel-standalone CDN for transpiling javascript es6 to es5.

Config

Check out index.js for configuration variables.

NUM_CLUSTERS = Number of clusters

NUM_POINTS = Number of points

MULTIPLY = Multiply results for better view in html