如何从jupyter的xgboost库中隐藏警告?

问题描述 投票:2回答:1

不工作:

import warnings
warnings.filterwarnings('ignore')

我得到的警告:

[14:24:45] WARNING: C:/Jenkins/workspace/xgboost-win64_release_0.90/src/objective/regression_obj.cu:152: reg:linear is now deprecated in favor of reg:squarederror.

它使我的输出在单元格中混乱。

xgboost
1个回答
0
投票

只需在模型的定义中添加silent = True

xgboost = xgb.XGBRegressor(random_state=42,silent=True)
© www.soinside.com 2019 - 2024. All rights reserved.