Xgboost parameters and stop criteria


#1

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?

thx


#2

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


#3

@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”?


#4

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


#5

got it. I should do it myself , thx lot