Skip to content

Commit

Permalink
Also skip if missing 'gbm'
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Jul 12, 2024
1 parent a5c3f6c commit bc05324
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/testthat/test-rstar.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ test_that("rstar works with draws_df example", {

test_that("rstar with uncertainty returns vectors of correct length", {
skip_if_not_installed("caret")
skip_if_not_installed("gbm")
x <- example_draws()
val <- rstar(x, method = "gbm", uncertainty = T, verbose = F)
expect_equal(length(val), 1000)
Expand All @@ -45,13 +46,15 @@ test_that("incorrect nsimulations values throws error", {

test_that("rstar with uncertainty returns reasonable values", {
skip_if_not_installed("caret")
skip_if_not_installed("gbm")
x <- example_draws()
val <- rstar(x, method = "gbm", uncertainty = T, verbose = F)
expect_true(max(val) > 0.3 & min(val) < 10)
})

test_that("rstar accepts different classifiers", {
skip_if_not_installed("caret")
skip_if_not_installed("gbm")
x <- example_draws()
val <- rstar(x, method = "gbm", verbose=F)
expect_true(is.numeric(val))
Expand All @@ -61,6 +64,7 @@ test_that("rstar accepts different classifiers", {

test_that("rstar accepts different hyperparameters", {
skip_if_not_installed("caret")
skip_if_not_installed("gbm")
x <- example_draws()

# use fast hyperparameters
Expand Down

0 comments on commit bc05324

Please sign in to comment.