README.md 667 Bytes
Newer Older
root's avatar
root committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# kmeans example

This example contains implementation of K-means clustering.


### How to demo
The demo contains a script that partitions data into groups using K-means clustering.
The demo can be run by the following command.

```
python kmeans.py [--gpu-id GPU_ID] [--n-clusters N_CLUSTERS] [--num NUM]
                 [--max-iter MAX_ITER] [--use-custom-kernel]
                 [--output-image OUTPUT_IMAGE]
```

If you run this script on environment without matplotlib renderers (e.g., non-GUI environment), setting the environmental variable `MPLBACKEND` to `Agg` may be required to use `matplotlib`. For example,

```
MPLBACKEND=Agg python kmeans.py ...
```