Which line are you referring to ? the index is chosen uniformly. There's a bug that was long since fixed in the comment/line above. It's not picking with probability 1/(currentSize+1) now.
Might rephrase these emails to be specific about what you think should change, and make sure you are referencing the latest version in SVN. On Sun, Jan 13, 2013 at 2:07 AM, sam wu <[email protected]> wrote: > Similar to MIA ch09 RandomPointUtil.java, random selection is not uniform > random. > > org.apache.mahout.clustering.kmeans.RandonSeedGenerator.java problem > > line 96-109 > > if (currentSize < k) { > > //select > > } else if (random.nextInt(currentSize + 1) != 0) { // with chance > 1/(currentSize+1) pick new element > > int indexToRemove = random.nextInt(currentSize); // evict one > chosen randomly > > // replace with new > > }
