简体   繁体   English

mlr3 - 预测的置信区间

[英]mlr3 - confidence interval for predictions

After tuning a learner and using it, we can use it to make predictions through the command line在调整学习器并使用它之后,我们可以使用它通过命令行进行预测

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

But, how do we compute confidence intervals for predictions?但是,我们如何计算预测的置信区间?


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")

Not all learners support prediction errors, xgboost being one of them.并非所有学习者都支持预测错误,xgboost 就是其中之一。 You'll have to use a different learner to get error estimates.您必须使用不同的学习器来获得错误估计。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM