@rahul485 wrote:
In this code fragment:
cvresult = xgb.cv(xgb_param, xgtrain, num_boost_round=1000, nfold=cv_folds, metrics='mlogloss', early_stopping_rounds=50)
alg.set_params(n_estimators=cvresult.shape[0])
How does this
cvresults.shape[0]
returns the optimal number of estimators (n_estimators
).
I thinknum_boost_round
denote the value ofn_estimators
used (increasing from 0 to 1000, early stopped by early_stopping_rounds), but I am not sure. What doesnum_boost_round
represent here, and more importantly, how to get the optimal number of estimators usingxgb.cv
?
Posts: 7
Participants: 2