首页 > 解决方案 > mlr3 - 预测的置信区间

问题描述

在调整学习器并使用它之后,我们可以使用它通过命令行进行预测

predict(Learner, newdata, predict_type="response")

但是,我们如何计算预测的置信区间?


task <- TaskRegr$new("data", data, "y")
learner <- lrn("regr.xgboost")
preprocess <- po("scale", param_vals = list(center = TRUE, scale = TRUE))
pp <- preprocess %>>% learner
gg<- GraphLearner$new(pp)
gg$train(task)
predict(gg, newdata = pred, predict_type="reponse")

标签: rmlr3

解决方案


并非所有学习者都支持预测错误,xgboost 就是其中之一。您必须使用不同的学习器来获得错误估计。


推荐阅读