kmeans: "did not converge in 10 iterations"

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

kmeans: "did not converge in 10 iterations"

Linda Lei
Hi All,

 

I run function "kmeans" to cluster a matrix. But when the matrix size is
big enough, it keeps saying "did not converge in 10 iterations". Could
you explain what it means and if the result is wrong?

 

And the interesting thing is sometimes this warning happens when the
sample size is around 51200 x 6, sometimes it happens around 30000 x 6.
Does the warning related to sample size or not?

 

This also happens in "bclust".

 

Thank you!

 

 


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: kmeans: "did not converge in 10 iterations"

Stéphane CRUVEILLER-2
On Thu, 2006-03-30 at 11:56 -0800, Linda Lei wrote:
> Hi All,
>
>  
>
> I run function "kmeans" to cluster a matrix. But when the matrix size is
> big enough, it keeps saying "did not converge in 10 iterations". Could
> you explain what it means and if the result is wrong?
>
It means that the partition obtained is not stable (i.e. the algorithm
did not converge
toward an optimal solution). Indeed, a supplementary iteration will
modify it significantly.

try to increase iter.max parameter (default set to 10)
$ x.kmeans<-kmeans(x,centers=3,iter.max=30)

Stéphane.



>  
>
> And the interesting thing is sometimes this warning happens when the
> sample size is around 51200 x 6, sometimes it happens around 30000 x 6.
> Does the warning related to sample size or not?
>
>  
>
> This also happens in "bclust".
>
>  
>
> Thank you!
>
>  
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
--
==========================================================
Stephane CRUVEILLER Ph. D.
Genoscope - Centre National de Sequencage
Atelier de Genomique Comparative
2, Rue Gaston Cremieux   CP 5706
91057 Evry Cedex - France
Phone: +33 (0)1 60 87 84 58
Fax: +33 (0)1 60 87 25 14
EMails: [hidden email] ,[hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: kmeans: "did not converge in 10 iterations"

Uwe Ligges
In reply to this post by Linda Lei
Linda Lei wrote:

> Hi All,
>
>  
>
> I run function "kmeans" to cluster a matrix. But when the matrix size is
> big enough, it keeps saying "did not converge in 10 iterations". Could
> you explain what it means and if the result is wrong?

What is the definition of "wrong" in cluster analysis?
The warning (not error!) says the algorithm did not converge, i.e. stuff
could have been changed in subsequent (not allowed) iterations or it
never converges (which we do not know using 10 iterations only).

So you should increase the number of max. allowed iterations in order to
give the algorithm a chance to converge.


> And the interesting thing is sometimes this warning happens when the
> sample size is around 51200 x 6, sometimes it happens around 30000 x 6.
> Does the warning related to sample size or not?

Not only. You might want to read the help page and the references for
the algorithm you are using.
If the starting set of centers is chosen well, convergence might happen
in a few iterations even for a big matrix, otherwise you might need some
more.

Uwe Ligges


>  
>
> This also happens in "bclust".
>
>  
>
> Thank you!
>
>  
>
>  
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html