Playing around with Clojure and k-means.
Clojure
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/k_means
test/k_means
.gitignore
LICENSE
README.md
k-means-demo.gif
k-means-demo.mov
project.clj

README.md

K-means

Demo of k-means in Clojure to make it easy to visualize 2-d k-means clustering algorithm.

GUI built on top of Quil.

K-means demo

Running the Demo

In the k-means folder, run:

lein repl

# Run tests
lein test

A window should pop up.

  • Left-click to spray points.
  • Right-click to add centers (up to six may be added).
  • [Space] to take one step in k-means clustering algorithm.
  • r will reset the points.

That's about it!

Miscellaneous

To run tests: lein test.

Or, to run tests in the REPL:

(ns k-means.core-test)
(run-tests)

;; Runs a specific test named test-my-test.
(test-my-test)