Skip to content

Commit

Permalink
remove skipped tests
Browse files Browse the repository at this point in the history
instead of re-enabling as in #215, test where functionality is defined in tidymodels/parsnip#1105
  • Loading branch information
simonpcouch committed Apr 5, 2024
1 parent ea7392a commit 00ca1b8
Showing 1 changed file with 0 additions and 106 deletions.
106 changes: 0 additions & 106 deletions tests/testthat/test-tunable.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,109 +151,3 @@ test_that("workflow with tunable recipe and model", {
c(rep("model_spec", 9), rep("recipe", 4))
)
})

# ------------------------------------------------------------------------------
# test specific values


test_that('test tunable parameter values', {
# depends on whether tune >= 0.1.6.9001 is installed
skip_if(inherits(try(tunable(), silent = TRUE), "try-error"))

print_parameters <- function(x) {
params <- tunable(x)
info <- params$call_info
names(info) <- params$names
print(info)
invisible(NULL)
}

expect_snapshot(
boost_tree(trees = tune(), min_n = tune(), sample_size = tune()) %>%
set_engine('C5.0') %>%
print_parameters()
)

expect_snapshot(
rules::C5_rules(trees = tune(), min_n = tune()) %>%
set_engine('C5.0') %>%
print_parameters()
)

expect_snapshot(
decision_tree(min_n = tune()) %>%
set_engine('C5.0') %>%
print_parameters()
)

expect_snapshot(
logistic_reg(penalty = tune()) %>%
set_engine('brulee') %>%
print_parameters()
)

expect_snapshot(
mars(prod_degree = tune()) %>%
set_engine('earth') %>%
set_mode('classification') %>%
print_parameters()
)

expect_snapshot(
multinom_reg(penalty = tune()) %>%
set_engine('brulee') %>%
print_parameters()
)

expect_snapshot(
rand_forest(mtry = tune(), min_n = tune()) %>%
set_engine('randomForest') %>%
set_mode('classification') %>%
print_parameters()
)

expect_snapshot(
rand_forest(mtry = tune(), min_n = tune()) %>%
set_engine('ranger') %>%
set_mode('classification') %>%
print_parameters()
)

expect_snapshot(
linear_reg(penalty = tune()) %>%
set_engine('brulee') %>%
print_parameters()
)

expect_snapshot(
boost_tree(
tree_depth = tune(),
trees = tune(),
learn_rate = tune(),
min_n = tune(),
loss_reduction = tune(),
sample_size = tune(),
stop_iter = tune()
) %>%
set_engine('xgboost') %>%
set_mode('classification') %>%
print_parameters()
)

expect_snapshot(
mlp(
hidden_units = tune(),
penalty = tune(),
dropout = tune(),
epochs = tune(),
activation = tune()
) %>%
set_engine('brulee') %>%
set_mode('classification') %>%
print_parameters()
)

})



0 comments on commit 00ca1b8

Please sign in to comment.