Is K-means cluster randomly each call time?

2 ビュー (過去 30 日間)
hamed abdulaziz
hamed abdulaziz 2014 年 3 月 21 日
回答済み: Kelly Kearney 2014 年 3 月 21 日
Hi All,
I tested the K-maens algorithm on the same image two times for testing(i.e by calling one after one )like this:
[idx1,ctrs1] = kmeans(image',4,'Distance','sqEuclidean');
[idx1,ctrs2] = kmeans(image',4,'Distance','sqEuclidean');
But I got different results where ctrs1 not equals ctrs2 as I expected !!
Could anyone tell me is K-means cluster randomly each call time? Thanks in advance to Matlab community.

回答 (1 件)

Kelly Kearney
Kelly Kearney 2014 年 3 月 21 日
By default, kmeans chooses its starting points at random. Take a look at the 'Start' option for details.

Community Treasure Hunt

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

Start Hunting!

Translated by