Skip to content

Commit

Permalink
Set random seed (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Sep 18, 2020
1 parent 55dc51f commit bb487bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/rstar_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ classif = @load XGBoostClassifier()
R = rstar(classif, randn(N,2), rand(1:3,N))

# Resulting R value should be close to one, i.e. the classifier does not perform better than random guessing.
@test mean(R) 1 atol=0.1
@test mean(R) 1 atol=0.15

# Compute R* statistic for a mixed chain.
R = rstar(classif, chn)

# Resulting R value should be close to one, i.e. the classifier does not perform better than random guessing.
@test mean(R) 1 atol=0.1
@test mean(R) 1 atol=0.15

# Compute R* statistic for a non-mixed chain.
niter = 1000
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using Test
using Random

# set seed for all testsets
Random.seed!(0)

@testset "MCMCChains" begin

Expand Down

0 comments on commit bb487bc

Please sign in to comment.