Hi, I want to use kmeans function in parallel, with a matlabpool of workers. When I open a matlabpool and then execute kmeans with Useparallel = true, only 1 core is working. The default numbers of workers is 4. What is wrong? Should I put the execution of the kmeans function inside a spmd block? Thanks in advance,
Jordi

1 Kommentar

Marwan Radwan
Marwan Radwan am 2 Okt. 2016
please i need this code and steps how to set useparallel i am new in matlab thank you alot

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Shashank Prasanna
Shashank Prasanna am 15 Mai 2013

1 Stimme

Hi Jordi, when the 'useparallel' flag set to true, KMEANS only computes the replicates in parallel.
If you have your replicates set to 1 you are unlikely to see a performance difference.
Try setting a larger 'replicates' to compare the performance difference.
Replicates are used to run kmeans several times with different start point so as to have a better chance of finding a global minimum and better centroids.

Weitere Antworten (2)

Thomas
Thomas am 15 Mai 2013

0 Stimmen

Don't know if this would help but you can find an implementation of k-means in MATLAB using MATLABmpi (message passing interface) http://www.cs.toronto.edu/~dross/code/parallel.shtml
Jordi
Jordi am 16 Mai 2013

0 Stimmen

Thanks a lot !
Jordi

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by