zenogantner/MyMediaLite — Issue #184: make random number generation with a seed reproducible in all cases
Author: zenogantner
Created: 2011-12-23 11:10:29+00:00
State: open
Labels: defect

reported by tomtung in #176:

It works fine here, too - but this depends on the definition of "different runs". In following code, for instance, each time the DoCrossValidation returns a different result:

var ratings = RatingData.Read(@".\Data\u.data");
var model = new MatrixFactorization() { Ratings = ratings };
while (true)
{
MyMediaLite.Util.Random.InitInstance(321);
var results = model.DoCrossValidation();
Console.WriteLine(results);
}
Allowing the Random object to be injected/passed as parameter might be worth trying.