I am following the mlr3 book and GitHub example:
library(mlr3verse)
task_penguins = as_task_classif(species ~ ., data = palmerpenguins::penguins)
learner = lrn("classif.rpart", cp = .01)
resampling = rsmp("cv", folds = 3L)
rr = resample(task_penguins, learner, resampling)
The resample command produces error:
Error: unable to find an inherited method for function ‘resample’ for signature ‘x = "TaskClassif", y = "LearnerClassifRpart"’
3.
stop(gettextf("unable to find an inherited method for function %s for signature %s",
sQuote(fdef@generic), sQuote(cnames)), call. = FALSE, domain = NA)
2.
(function (classes, fdef, mtable)
{
methods <- .findInheritedMethods(classes, fdef, mtable)
if (length(methods) == 1L) ...
1.
resample(task_penguins, learner, resampling)
What's this error, and how can I solve it?
Looks like you loaded a package that overwrites `mlr3::resample()`. Restart your R session.