如何使用 xgb.train 在我的 xgboost 模型中指定树的数量?

How can I specify the number of the trees in my xgboost model ,using xgb.train?

如果我使用 xgb.train,我如何指定模型中的树数?

在xgboost.XGBRegressor()中,我知道可以使用参数'n_estimators',但是在xgb.train()中我应该做什么呢?

我搜索了Google但没有找到任何答案,在此先感谢。

num_boost_round。正如 api documentation 中所述:

num_boost_round (int) – Number of boosting iterations.

要完全匹配 xgb.train 和 scikit 包装器(XGBRegressor 或 XGBClassifier)的输出,您可以在此处查看我的其他答案: