zenogantner / MyMediaLite

recommender system library for the CLR (.NET)
http://mymedialite.net
499 stars 192 forks source link

Update RatingCrossValidationSplit.cs #465

Closed JoesGab closed 7 years ago

JoesGab commented 7 years ago

Problem: Assigning indices to the folds is not really random. Easily reproducible by checking the results on a simple recommender, such as the ItemAverage, and k-fold CV. Fold[i] always has the same result over multiple runs.

Reason: Each int in random_indices will eventually get assigned to the same fold as you iterate over the content of random_indices (the entity indices).

Fix: Iterate over indices of random_indices instead.

zenogantner commented 7 years ago

Thank you for your contribution!