A animation demo for k-means, idea from mlhub's model.
- Suitable for Ubuntu system, to install mlhub python package:
$ pip3 install mlhub
- To install and configure the package(if have previous version, please
ml removefirst):
$ ml install davecatmeow/showcase-demo
$ ml configure kmeans
$ ml demo kmeans
$ ml train kmeans [k] [input.csv] -o [output.csv]
or
$ ml train kmeans [k] [input.csv] > [output.csv]
With input dataset n lines and f features, the output will be:
n+klines where the additionklines represents thekcenters of clustersf+1columns where the addition column represents labels of data
ml predict kmeans [options] [modelfile] <csvfile>
-o <file.csv> --output=<file.csv> Save the output predictions to file.