Statham
Statham

Reputation: 4118

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

If I use xgb.train, how can i specify the number of the trees in my model ?

In xgboost.XGBRegressor(), I know i can use parameter 'n_estimators', but what should I do in xgb.train()?

I searched Google and didn't find any answer, thanks in advance.

Upvotes: 3

Views: 3828

Answers (1)

Vivek Kumar
Vivek Kumar

Reputation: 36599

Its num_boost_round. As stated on the api documentation:

num_boost_round (int) – Number of boosting iterations.

To exactly match the output of xgb.train and scikit wrapper (XGBRegressor or XGBClassifier) you can look at my other answer here:

Upvotes: 4

Related Questions