Yup- it's in the unit test helper class.

core/src --- org.apache.mahout.common.MahoutTestCase:

public abstract class MahoutTestCase extends 
org.apache.mahout.math.MahoutTestCase {
...

  @Override
  @Before
  public void setUp() throws Exception {
    super.setUp();
    RandomUtils.useTestSeed();  <<<<-------- Deterministic random seed
    testTempDirPath = null;
    fs = null;
  }



----- Original Message -----
| From: "Dmitriy Lyubimov" <[email protected]>
| To: [email protected]
| Sent: Monday, September 3, 2012 11:54:10 PM
| Subject: Random generator from random utils
| 
| Hello,
| 
| i have a question regarding line 344 in SSVDSolver:
| 
| 
| Random rnd = RandomUtils.getRandom();
| 
| This random generator is used to obtain initial seed for random
| matrix
| of SSVD. It used to be just "new Random()" but at some point
| apparently was replaced with that util call.
| 
| At least in unit test this seems to result in situation that unit
| test
| essentially gets a deterministic random gen. My guess is the intent
| is
| to keep unit tests from failing non-deterministically from time to
| time.
| 
| but am i right assuming that outside of Mahout's unit test this
| actually will always be non-deterministic and I will be getting
| different seeds? Cause if i don't, i think that's a problem.
| 
| Thanks.
| -Dmitriy
| 

Reply via email to