Nothing
# Train model:
library(mlr3verse)
library(ranger)
data(bikes, package = "fmeffects")
set.seed(123)
task = as_task_regr(x = bikes, target = "count")
forest = lrn("regr.ranger")$train(task)
testthat::test_that("FME computation correct for univariate numeric vignette example", {
ame = fme(model = forest,
data = bikes,
features = list(temp = 1),
ep.method = "envelope")$ame
testthat::expect_equal(ame, 56.7, tolerance = 0.3)
})
testthat::test_that("FME computation correct for multivariate vignette example", {
ame = fme(model = forest,
data = bikes,
features = list(temp = -3, humidity = -0.1),
ep.method = "envelope")$ame
testthat::expect_equal(ame, -118, tolerance = 0.3)
})
testthat::test_that("FME computation correct for categorical vignette example", {
ame = fme(model = forest,
data = bikes,
features = list(weather = "rain"))$ame
testthat::expect_equal(ame, -55.50291, tolerance = 1)
})
testthat::test_that("FME computation correct for categorical interactions vignette example", {
ame = fme(model = forest,
data = bikes,
features = list(weather = "clear", workingday = "no"))$ame
testthat::expect_equal(ame, -175.7891, tolerance = 2)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.