Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also skip if missing 'gbm' #373

Merged
merged 1 commit into from
Jul 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading