JuliaStats / Lasso.jl

Lasso/Elastic Net linear and generalized linear models
Other
143 stars 31 forks source link

Test using StableRNGs #55

Closed AsafManela closed 3 years ago

AsafManela commented 3 years ago

Starting with Julia 1.5 random number generators are not guaranteed to provide the same sequence of numbers for a given seed (see here).

This PR replaced the global rng used in tests with a StableRNG called testrng and uses it everywhere. Turns out that was not enough because Lasso.jl has a RandomCoefficientIterator that uses its own RNG. So to get deterministic test, I also add the ability to specify an rng in the call to fit(...; rng=StableRNG(123)).

Tests now seem to pass on 1.5. Closes #48

codecov-io commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@81ec2a4). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #55   +/-   ##
=========================================
  Coverage          ?   92.45%           
=========================================
  Files             ?        8           
  Lines             ?     1113           
  Branches          ?        0           
=========================================
  Hits              ?     1029           
  Misses            ?       84           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 81ec2a4...b4f5c21. Read the comment docs.

AsafManela commented 3 years ago

Hi @andreasnoack, do you have time to review this one or should I just merge?