5.0

5.0 | 1 rating Rate this file 78 Downloads (last 30 days) File Size: 1.46 MB File ID: #33541
image thumbnail

Fast K-means clustering

by

 

31 Oct 2011 (Updated )

Fast mex K-means clustering algorithm with possibility of K-mean++ initialization.

| Watch this File

File Information
Description

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"

Required Products MATLAB
MATLAB release MATLAB 7.9 (R2009b)
Other requirements For a full usage, a OpenMP C compiler compliant such MSCV/Intel compiler/GCC. Shoud work with LCC but without OpenMP support.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (13)
07 Jun 2013 Kota Hara  
07 Jun 2013 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.

06 Jun 2013 Sebastien PARIS

Kota,

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

31 May 2013 Sebastien PARIS

Kota,

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

30 May 2013 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?

26 Dec 2012 Sebastien PARIS

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

26 Dec 2012 Sepehr Farhand

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

02 Oct 2012 Sebastien PARIS

Leila ...

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

03 Jul 2012 leila

Does the code support 3d data?

29 Jun 2012 Sebastien PARIS

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

28 Jun 2012 Bonolo

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

otherwise compiles fine.

30 May 2012 Sebastien PARIS

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)

30 May 2012 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
01 Nov 2011

- Add online help, minor changes

04 Nov 2011

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

24 Mar 2012

-Correct a bug in randperm

29 Jun 2012

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

27 Sep 2012

- Fix a bug in ndellipse introduced in the last update

09 Nov 2012

- 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)

Contact us