context("Resampling")
test_that("param_vals", {
task = tsk("petrol")
r = rsmp("forecast_cv", folds = 10L, horizon = 3L, window_size = 5L, fixed_window = FALSE)
expect_identical(r$param_set$values$folds, 10L)
expect_identical(r$param_set$values$horizon, 3L)
expect_identical(r$param_set$values$window_size, 5L)
expect_identical(r$param_set$values$fixed_window, FALSE)
r$instantiate(task)
expect_true(r$is_instantiated)
expect_identical(r$iters, 10L)
expect_equal(intersect (r$test_set(1),r$train_set(1)), integer(0))
expect_integerish(r$test_set(10), len = 3)
expect_resampling(r)
r$param_set$values$fixed_window=TRUE
r$instantiate(task)
expect_true(r$is_instantiated)
expect_identical(r$iters, 10L)
expect_equal(intersect (r$test_set(1),r$train_set(1)), integer(0))
expect_integerish(r$test_set(10), len = 3)
expect_integerish(r$train_set(10), len = 5)
expect_resampling(r)
task = tsk("petrol")
r = rsmp("forecast_holdout", ratio = 0.7)
expect_identical(r$param_set$values$ratio, 0.7)
r$instantiate(task)
expect_true(r$is_instantiated)
expect_identical(r$iters, 1L)
expect_equal(intersect (r$test_set(1),r$train_set(1)), integer(0))
expect_resampling(r)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.