不工作:
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.
它使我的输出在单元格中混乱。
只需在模型的定义中添加silent = True
:
xgboost = xgb.XGBRegressor(random_state=42,silent=True)