项目作者: levibyte

项目描述 :
k-means implementation for 2D points data ( SDL )
高级语言: C++
项目地址: git://github.com/levibyte/kmeans_demo.git
创建时间: 2017-03-01T12:34:04Z
项目社区:https://github.com/levibyte/kmeans_demo

开源协议:

下载


kmeans_demo

The question is following: Given number K and some data, classify and put data into K buckets.

This is silly atempt to address this question by implementing k-means, the most basic classification algorithm. For simplicty and visbility reasons I’ve choosen data to be 2d points on the surface.

Overall algorithm’s yield is very much depends on data distribution ( are they allready “split” into K buckets or spread randomly?) and on the choice of first pivot points. Therfore on some occasions it can split data ideally but next time it can be completly wrong.

Run examples

Left: raw data, Right: after classification to buckets ( via color )

Same, but for larger gravity values:

Fail case: