the warning appears when using k-means

4 visualizaciones (últimos 30 días)
Y
Y el 13 de Oct. de 2017
Respondida: Image Analyst el 13 de Oct. de 2017
Hi, everyone When I learn to use the K-means from demo: train a K-means clustering algorithm. Then I run this demo.
if true
% idx2Region=kmeans(XGrid,3,'MaxIter',1,'Start',C);
end
After I input this sentence, the warning appears as followed.
if true
% fail to converge in 1 iterations
in Kmeans>loopbody at 438
end
Could u give the reason for that and how to solve that ?
Thanks in advance.
Helena

Respuestas (2)

Image Analyst
Image Analyst el 13 de Oct. de 2017
I'd guess that you either don't have very many points in your data, or you don't have any clusters in your data.

KSSV
KSSV el 13 de Oct. de 2017
kmeans displayed a warning stating that the algorithm did not converge, which you should expect since the software only implemented one iteration.
Don't specify the maximum number of iterations..let the code converge itself.....or if you insist on iterations increase the number of iterations.
Read about kmeans algorithm to get more information.

Categorías

Más información sobre k 均值聚类和 k 中心点聚类 en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!