Skip to content

Commit

Permalink
Update assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion committed Jul 7, 2023
1 parent da8cefa commit 47eacaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tutorials/05-linear-regression/05_linear-regression.jmd
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ It looks like all parameters have converged.
```julia; echo=false
let
ess_df = ess(chain)
@assert minimum(ess_df[:, :ess]) > 700 "Minimum ESS: $(minimum(ess_df[:, :ess])) - not > 700"
@assert minimum(ess_df[:, :ess]) > 500 "Minimum ESS: $(minimum(ess_df[:, :ess])) - not > 700"
@assert mean(ess_df[:, :ess]) > 2_000 "Mean ESS: $(mean(ess_df[:, :ess])) - not > 2000"
@assert maximum(ess_df[:, :ess]) > 4_000 "Maximum ESS: $(maximum(ess_df[:, :ess])) - not > 4000"
end
Expand Down Expand Up @@ -228,7 +228,7 @@ let
bayes_test_loss = msd(test_prediction_bayes, testset[!, target])
ols_train_loss = msd(train_prediction_ols, trainset[!, target])
ols_test_loss = msd(test_prediction_ols, testset[!, target])
@assert bayes_train_loss < bayes_test_loss "Bayesian training loss ($bayes_train_loss) >= Bayesian test loss ($bayes_test_loss)"
@assert bayes_train_loss < bayes_test_loss "Bayesian training loss ($bayes_train_loss) >= Bayesian test loss ($bayes_test_loss)"
@assert ols_train_loss < ols_test_loss "OLS training loss ($ols_train_loss) >= OLS test loss ($ols_test_loss)"
@assert isapprox(bayes_train_loss, ols_train_loss; rtol=0.01) "Difference between Bayesian training loss ($bayes_train_loss) and OLS training loss ($ols_train_loss) unexpectedly large!"
@assert isapprox(bayes_test_loss, ols_test_loss; rtol=0.05) "Difference between Bayesian test loss ($bayes_test_loss) and OLS test loss ($ols_test_loss) unexpectedly large!"
Expand Down

0 comments on commit 47eacaa

Please sign in to comment.