Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Optimize `n_estimators` using `xgb.cv`

$
0
0

@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 think num_boost_round denote the value of n_estimators used (increasing from 0 to 1000, early stopped by early_stopping_rounds), but I am not sure. What does num_boost_round represent here, and more importantly, how to get the optimal number of estimators using xgb.cv?

Posts: 7

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles