我正在尝试将以下XGBoost模型转换为CoreML文件,但出现错误。

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'

我使用pip安装了xgboost。为什么会这样呢?

最佳答案

我有xgboost 0.61的版本,而我移到了0.81,这解决了我的问题。

关于python - 将XGBoost模型转换为CoreML,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/44932187/

10-12 23:17