Rui Esteves
2012-Jan-13 10:53 UTC
[R] how to find the number of iterations kmeans used to converge?
Dear all, I need to know in which number of iterations the kmeans converge each time I run it. Any idea how to do it? Thank you for your attention, Rui
David Winsemius
2012-Jan-13 13:16 UTC
[R] how to find the number of iterations kmeans used to converge?
On Jan 13, 2012, at 5:53 AM, Rui Esteves wrote:> Dear all, > > I need to know in which number of iterations the kmeans converge each > time I run it. > Any idea how to do it? >Look at the help page (to see that it is not part of the returned object) and then look at the code (to see that the object returned from the .C() call is immediately checked to see if the number of iterations exceeded the maximum set by the user. Search for this code: if (Z$iter > iter.max) Then you should be able to see your way forward. You can either create a modified return object or you can insert a line that prints that value. -- David Winsemius, MD West Hartford, CT