Pek
Pek

Reputation: 166

XGBoost: fit() got an unexpected keyword argument 'xgb_model'

According to the documentation, it should be possible to write the code like this:

# Instantiate the model
model = XGBClassifier() 
model.fit(x, y, xgb_model='model.xgb')

But it fails with :

TypeError: fit() got an unexpected keyword argument 'xgb_model'

The reference: http://xgboost.readthedocs.io/en/latest/python/python_api.html

xgb_model (str) – file name of stored xgb model or ‘Booster’ instance Xgb model to be loaded before training (allows training continuation).

Am I missing anything?

Upvotes: 1

Views: 2393

Answers (1)

alecxe
alecxe

Reputation: 474141

xgb_model argument was added to the fit() method quite recently (Oct 1). Make sure you have the latest xgboost version installed.

Upvotes: 1

Related Questions