File Exchange

image thumbnail

Fast K-means clustering

version 1.6.0.0 (1.46 MB) by Sebastien PARIS
Fast mex K-means clustering algorithm with possibility of K-mean++ initialization.

5 Downloads

Updated 09 Nov 2012

View License

Fast mex K-means clustering algorithm with possibility of K-mean++ initialization
(mex-interface modified from the original yael package https://gforge.inria.fr/projects/yael)

- Accept single/double precision input
- Support of BLAS/OpenMP for multi-core computation

Please run mexme_yael_kmeans.m to compile mex-files (be sure that mex -setup have been done at least one)

Run demo "test_yael_kmeans.m"

Comments and Ratings (14)

Kathrin

Dear Sebastien,
I had compiled the mex-files successfully.The "sample_mvgm" and " ndellipse" were executed successfully while there were something wrong with "yael_kmeans".It was reported that "matlab has matlab has encountered an internal problem and needs to close ".
Please give me a hand.
Compiler: Microsoft Software Development Kit (SDK) 7.1
MatlabRelease: matlab 7.14.0.739 (R2012a)

Kota Hara

Kota Hara

Thank you for checking. The reason is that there are cases where the cardinality of the data is unknown before applying clustering. Well, I can first check the cardinality of the data and then use k <= cardinality but I just thought it would be great if your code could handle that situation.

Kota,

I confirmed the bahaviour. In another way, why ask more clusters than the cardinality of your data ?

Kota,

Thank you for reporting.... I will check this

Kota Hara

My input data X is a set of one dimensional scalar and the values are taken from a finite discrete set S, e.g., S = {1,2,3,4,5}. When I run yael_kmeans with K>|S|, it looks like yael_kmeans goes into an infinite loop. Do you have any idea on how to fix it?

Sepehr,
Can you indicate what is your OS, CPU and compiler used ? Did you recompile mex-files also ?

Matlab crashes w/ segmentation fault. I guess you have a loose pointer somewhere. "Segmentation violation detected"

Leila ...

It supports of course 3d vectors or more ...

leila

Does the code support 3d data?

Thank you for reporting ...
The update with correction will be published soon.

Bonolo

on the mac, need to change lib= '-lmwblas'; to libblas= '-lmwblas';

otherwise compiles fine.

Vladimir,

Did you compile mex-files first ?

Please run mexme_yael_kmeans.m to compile mex-files (be sure that mex -setup have been done at least one)

Vladimir

Using MSVC++ 2010 compiler, sample_mvgm throws an error when called in test_yael_kmeans:
"mu must be (d x 1 x M x n1 x ... x nl)"
where
mu = cat(3 , [-2.5 ; -3] , [0 ; 0] ,[ 5 ; 5]); %(d x 1 x M)

Updates

1.6.0.0

- Fix compilation issue in mexme_yael_kmeans
- Include both mexw32 & mexw64 files in two separate files (unzip them in local dir in case of problem)

1.5.0.0

- Fix a bug in ndellipse introduced in the last update

1.4.0.0

-Correct a bug in mexme_yael_kmeans.m for Linux/Mac Os

1.3.0.0

-Correct a bug in randperm

1.2.0.0

- Minor changes
- Add spiral clustering example in the test file

1.1.0.0

- Add online help, minor changes

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: Sparsified K-Means, Ziheng_GMM.zip