I am getting this warning message while executing the k means cluster algorithm ?

Warning: Failed to converge in 100 iterations.
> In kmeans/loopBody (line 479)
In internal.stats.parallel.smartForReduce (line 136)
In kmeans (line 343)
In sav (line 27)

댓글 수: 3

Try to increase the number of iterations
kmeans(data,k,'MaxIter',10000)
You forgot to attach your data. I'll check back later for it.
The coding for k means algorithm is here
numberOfClusters = 7;
grayLevels = double(g(:));
[clusterIndexes, clusterCenters] = kmeans(grayLevels, numberOfClusters,...
'distance', 'sqEuclidean', ...
'Replicates', 2);
labeledImage = reshape(clusterIndexes, rows, columns);

댓글을 달려면 로그인하십시오.

답변 (0개)

질문:

2021년 6월 18일

댓글:

2021년 6월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by