Joshua Herman
Joshua Herman

Reputation: 133

Converting XGBoost model to CoreML

I am trying to convert the following XGBoost model to a CoreML File but I get the error.

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-
  packages/coremltools/converters/xgboost/_tree.py", line 48, in convert
return _MLModel(_convert_tree_ensemble(model, feature_names, target))
File "/usr/local/lib/python2.7/dist-
 packages/coremltools/converters/xgboost/_tree_ensemble.py", line 111, in convert_tree_ensemble
xgb_model_str = model.get_dump(with_stats=True, dump_format = 'json')
TypeError: get_dump() got an unexpected keyword argument 'dump_format'

I installed xgboost using pip. Why is this occurring?

Upvotes: 1

Views: 590

Answers (2)

deltascience
deltascience

Reputation: 3390

I had the version of xgboost 0.61 and I moved to 0.81 and that solved my issue.

Upvotes: 1

Joshua Herman
Joshua Herman

Reputation: 133

Follow the installation guide. Do not use pip install xgboost or you will get this error with get_dump. See http://xgboost.readthedocs.io/en/latest/build.html for more information.

Upvotes: 0

Related Questions