N_estimator and number of booster


#1

Hi,

According to this stackoverflow post,
If I am correct, parameter of n_estimators in xgboost.XGBClassifier() should be equal to number of booster.

But after I tried:

iris = datasets.load_iris()
X = iris.data 
y = iris.target
model = XGBClassifier(n_estimators=5)
model.fit(X, y)
model.get_booster().dump_model("xgb_model.txt")

The dump_model have > 5 boosters which is confused me.


#2

This is because Iris dataset has 3 classes, so we are performing multi-class classification. For multi-class classification task, XGBoost will fit [number of boosting rounds] * [number of classes] trees.