xgboost.fit() vs. xgboost.train()

Viewed 126

I am looking over the docs in XGBoost, but I am not understanding 1) if there are any differences between using xgboost.fit() vs. xgboost.train(), and 2) if there are any advantages/disadvantages using one over the other?

I think the only one I've identified so far is that you can specify more params with the train() function, but I'm not entirely sold that you cannot specify those same params somewhere within the fit() function as well.

1 Answers

Taking most points from this related answer on the use of DMatrix in xgboost:

  1. The XGBoost Python package allows choosing between two APIs. The Scikit-Learn API has objects XGBRegressor and XGBClassifier trained via calling fit. XGBoost's own Learning API has xgboost.train. You probably could specify most models with any of the two choices.

  2. Mostly a matter of personal preference. The scikit-learn API makes it easy to utilize some of the tools available in scikit-learn (model selection, pipelines etc.)

Related