mt-cly / KMeans

it's just the course work of Parttern Recognition, made with python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KMeans

It's just the course work of Parttern Recognition, made with python.

First, you should pack your data of points up to a numpy.array, and save it as a .npy.——just like the file 'sample_pnts.npy'.
Then, run the K-means.py. The params of K-means.py should include the path of .npy file at least. And the second param 'CLASS_NUM' is not required.
You can get the message like 'class_center_points location', 'loss value', 'divide result' if you have setted CLASS_NUM with '-c'.
if CLASS_NUM don't be setted, the project would calculate the results in different situation of CLASS_NUM=1, CLASS_NUM=2, CLASS_NUM=3,....Finally, draw those result in the matplot. So you can get a image shows the varity of loss and CLASS_NUM.

Command sample:
python K-means.py sample_pnts.npy -c 3
python K-means.py sample_pnts.npy

About

it's just the course work of Parttern Recognition, made with python.

License:The Unlicense


Languages

Language:Python 100.0%