Skip to content

Commit

Permalink
tests: set_fallback quantiles
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Aug 30, 2024
1 parent 2deea95 commit 65cc2c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/test_set_fallback.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,16 @@ test_that("set_fallback() works", {
expect_class(learner, "LearnerRegrDebug")
expect_class(learner$fallback, "LearnerRegrFeatureless")
expect_equal(learner$fallback$predict_type, "se")

learner = lrn("regr.debug",
predict_type = "quantiles",
quantiles = c(0.1, 0.9),
quantile_response = 0.1)
set_fallback(learner)

expect_class(learner, "LearnerRegrDebug")
expect_class(learner$fallback, "LearnerRegrFeatureless")
expect_equal(learner$fallback$predict_type, "quantiles")
expect_equal(learner$fallback$quantiles, c(0.1, 0.9))
expect_equal(learner$fallback$quantile_response, 0.1)
})

0 comments on commit 65cc2c5

Please sign in to comment.