aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2019-02-05 01:09:35 -0500
committerPaul Duncan <pabs@pablotron.org>2019-02-05 01:09:35 -0500
commite1d09044f2208cda7e7667cbcff978008997ed48 (patch)
treed4b4454f1da719f1526b73a62902caedfe4f8c4e /README.md
parente63a88ea567744d890d923d1d7aa46e583cbb0ec (diff)
downloadkmeans-e1d09044f2208cda7e7667cbcff978008997ed48.tar.bz2
kmeans-e1d09044f2208cda7e7667cbcff978008997ed48.zip
remove cruft from main.c, add more to README.md
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 21 insertions, 5 deletions
diff --git a/README.md b/README.md
index 0238485..3667e8c 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,24 @@
KMeans Classifier Implementation
-Example:
- # generate test data with 1000 rows clustered around 3 points
- ./gen-data.rb 1000 3 > example.dat
+Examples:
- # classify data, plot results as png
- ./km-test kmeans example.dat example.png
+Generate 1000 rows of test data, clustered around 3 points:
+
+ # generate test data
+ ./gen-data.rb 1000 3 > example.dat
+
+ # classify data, plot results as png
+ ./km-test kmeans example.dat example.png
+
+Run all tests and save best clustering in current directory along with
+PNGs of results:
+
+ for i in tests/*dat; do
+ # build paths
+ png_path=kmeans-$(basename ${i/dat/png})
+ dst_path=kmeans-$(basename $i)
+
+ # run test
+ echo $i
+ ./km-test kmeans $i $png_path > $dst_path
+ done