kmeans clustering
by Mo Chen
01 Jul 2009
(Updated 04 Feb 2012)
Fully vectorized kmeans algorithm. Fast yet simple (10 lines)
|
Watch this File
|
| File Information |
| Description |
This is a very fast implementation of the original kmeans clustering algorithm without any fancy acceleration technique, such as kd-tree indexing and triangular inequation. (actually the fastest matlab implementation as far as I can tell.)
This code is as vectorized as possible. Yet it is very compact (only 10 lines of code). It is 10~100 times faster than the kmeans function in matlab.
The package also includes a function for ploting the data with labels.
Sample code:
>> load data;spread(x,y)
>> label = litekmeans(x,3);spread(x,label )
Detail explanation of this algorithm can be found in following blog post:
http://statinfer.wordpress.com/2011/12/12/efficient-matlab-ii-kmeans-clustering-algorithm/ |
| Acknowledgements |
This file inspired
Kmeans and K Means++.
|
| MATLAB release |
MATLAB 7.11 (R2010b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 01 Jul 2009 |
update the files and description |
| 20 Mar 2010 |
fix a bug for 1d data |
| 30 Sep 2010 |
remove empty clusters according to suggestion |
| 30 Sep 2010 |
remove empty clusters according to suggestion |
| 07 Jan 2012 |
Cleaning up |
| 04 Feb 2012 |
tuning |
|
Contact us