Skip to content

Commit

Permalink
tune test with grid = 2 instead of 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Athospd committed Aug 2, 2020
1 parent b1f1a35 commit e0b6c78
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/testthat/helper-model.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,19 @@ expect_can_tune_boost_tree <- function(model) {
mtcars$cyl <- factor(mtcars$cyl)
mtcars$vs <- factor(mtcars$vs)

grid_df <- data.frame(trees = c(10, 20))
resamples <- rsample::vfold_cv(mtcars, v = 2)

# regression
adj <- tune::tune_grid(
parsnip::set_mode(model, "regression"),
mpg ~ .,
resamples = resamples,
grid = 3,
grid = 2,
metrics = yardstick::metric_set(yardstick::rmse)
)

expect_equal(nrow(adj), nrow(resamples))
expect_equal(nrow(tune::collect_metrics(adj)), 3)
expect_equal(nrow(tune::collect_metrics(adj)), 2)
expect_true(all(!is.nan(tune::collect_metrics(adj)$mean)))

# classification
Expand Down

0 comments on commit e0b6c78

Please sign in to comment.