diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -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 |