Hi Suman, For maxIterations, are you using the DenseKMeans.scala example code? (I'm guessing yes since you mention the command line.) If so, then you should be able to specify maxIterations via an extra parameter like "--numIterations 50" (note the example uses "numIterations" in the current master instead of "maxIterations," which is sort of a bug in the example). If that does not cap the max iterations, then please report it as a bug.
To specify the initial centroids, you will need to modify the DenseKMeans example code. Please see the KMeans API docs for details. Good luck, Joseph On Mon, May 18, 2015 at 3:22 AM, MEETHU MATHEW <meethu2...@yahoo.co.in> wrote: > Hi, > I think you cant supply an initial set of centroids to kmeans > > Thanks & Regards, > Meethu M > > > > On Friday, 15 May 2015 12:37 AM, Suman Somasundar < > suman.somasun...@oracle.com> wrote: > > > Hi,, > > I want to run a definite number of iterations in Kmeans. There is a > command line argument to set maxIterations, but even if I set it to a > number, Kmeans runs until the centroids converge. > Is there a specific way to specify it in command line? > > Also, I wanted to know if we can supply the initial set of centroids to > the program instead of it choosing the centroids in random? > > Thanks, > Suman. > > >