Closed dandls closed 7 months ago
Problem: Unfortunately, the column name of the output of the default predict-function for mlr3 LearnerRegr is rather messy.
predict
mlr3
LearnerRegr
Example:
> library("mlr3") > library("rpart") > library("iml") > > task = tsk("mtcars") > task$target_names [1] "mpg" > > mod = lrn("regr.rpart")$train(task) > > pred = Predictor$new(mod, data = task$data(), y = "mpg") > head(pred$predict(task$data())) predict.model..newdata...newdata. 1 18.26429 2 18.26429 3 26.66364 4 18.26429 5 18.26429 6 18.26429
Solution: This line of code should be replaced, e.g., by data.frame(pred = predict(model, newdata = newdata)).
data.frame(pred = predict(model, newdata = newdata))
maybe call it 'response' to be consistent with mlr3?
Problem: Unfortunately, the column name of the output of the default
predict
-function formlr3
LearnerRegr
is rather messy.Example:
Solution: This line of code should be replaced, e.g., by
data.frame(pred = predict(model, newdata = newdata))
.