Scikit learn API xgboost allow for online training?

Viewed 593

According to the API, it seems like the normal xgboost interface allows for this option:

xgboost.train(params, dtrain, num_boost_round=10, evals=(), obj=None, feval=None, maximize=False, early_stopping_rounds=None, evals_result=None, verbose_eval=True, xgb_model=None, callbacks=None, learning_rates=None).

In this option, one can input xgb_model to allow continued training on the same model.

However, I'm using the scikit learn API of xgboost so I can put the classifier in a scikit pipeline, along with other nice tools such as random search for hyperparameter tuning.

So does anyone know of any (albeit hacky) way of allowing online training for the scikitlearn api for xgboost?

1 Answers

I don't think the sklearn wrapper has an option to incrementally train a model. The feat can be achieved to some extent using the warm_start parameter. But, the sklearn wrapper for XGBoost doesn't have that parameter. So, if you want to go for incremental training you might have to switch to the official API version of xgboost.

Related