On Wed, Jul 1, 2009 at 12:20 PM, Sean Owen <[email protected]> wrote: > 1. Make the algorithm truly select a random k elements? >
Sounds like a good thing to do, but not a big issue. I presume you would do it using the standard exchange algorithm for generating the prefix of a permutation? > 2. May we standardize on the RandomUtils class for creating random > number generators? it means we can control the implementation, but > better, can make it deterministic at will for testing > I would like to bring commons math more and more into Mahout with the aim of getting higher quality vector and matrix implementations. They also have provisions for sampling from various distributions that will make some algorithms much easier. RandomUtils is in commons.lang.math which is a separate class/package/world entirely. It seems to provide almost no added value over Random. In particular, I don't see why this helps make random numbers more deterministic than any competent PRNG implementation. All implementations that I know of allow seeding. The javadoc on RandomUtils does not inspire confidence in me since it implies that it inherits the well-known defects of java.math.Random. The key here is just to allow (but not require) the RNG to be injectable for any class that needs to generate random numbers. What value does RandomUtils bring over temporary use of java.math.Random and long term use of commons math RandomData? 3. And may I fix up some style stuff... for instance nothing should be > both 'transient' and 'static', and "== true" is redundant, etc. > Style is generally good to improve. The ones you mention seem non-controversal.
