使用XGBoost随机森林,如何从每棵树中提取预测?

发布于 2025-02-07 16:30:08 字数 423 浏览 1 评论 0 原文

使用Sklearn Randomforest,您可以像这样的每棵树的每棵树的预测:

per_tree_pred = [tree.predict(X) for tree in clf.estimators_]

xgboost作为安装随机森林的选项,这很不错,因为我们可以利用GPU,但是有什么方法可以像我们在Sklearn中一样从每棵树上获得预测?这对于了解预测的不确定性可能非常有用。

谢谢,

With the sklearn RandomForest, you can get the prediction of each tree of the random forest like so:

per_tree_pred = [tree.predict(X) for tree in clf.estimators_]

xgboost as the option of fitting random forest, which is quite nice since we can leverage the GPU, but is there any way to get the prediction from each tree like we can in sklearn? This can be very useful to get a sense of the uncertainty of the predictions.

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文