Xgboost parameters and stop criteria


I try to use xgboost to analyze regression problem.

Comparing with random forest regressor, does xgboost not have n_estimators arg? why?

If xgboost doesn’t have that, how does it know when to stop training?
Or it find the combination which has the lowest loss function?



Here it is: https://xgboost.readthedocs.io/en/latest/python/python_api.html#xgboost.XGBRegressor


@hcho3 , Thx the link.

If I init the object like:
m = xgb.train({'objective': 'reg:linear', 'verbose': False}, xgb.DMatrix(train_X, label=train_y),...)

Does it automatically create the xgb.XGBRegressor() object base on the parameters “reg:linear”?


No, you should directly create XGBRegressor object directly. See https://github.com/dmlc/xgboost/blob/master/demo/guide-python/sklearn_examples.py


got it. I should do it myself , thx lot