A wrapper function that creates the correct subclass of Predictor
by automatically from model
. Can be passed to the constructor of FME
.
Examples
# Train a model:
library(mlr3verse)
data(bikes, package = "fmeffects")
task = as_task_regr(x = bikes, id = "bikes", target = "count")
forest = lrn("regr.ranger")$train(task)
# Create the predictor:
predictor = makePredictor(forest, bikes)
# This instantiated an object of the correct subclass of `Predictor`:
class(predictor)
#> [1] "PredictorMLR3" "Predictor" "R6"