Skip to content

Commit

Permalink
Fixes #396, xgboost converter for xgboost >= 1.0.2 (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
xadupre authored Jun 1, 2020
1 parent 4e7c0f0 commit 18c4dc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion onnxmltools/convert/xgboost/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ def get_xgb_params(xgb_node):
else:
# XGBoost < 0.7
params = xgb_node.__dict__


if ('n_estimators' not in params and
hasattr(xgb_node, 'n_estimators')):
# xgboost >= 1.0.2
params['n_estimators'] = xgb_node.n_estimators
return params
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ scikit-learn
scipy
svm
wheel
xgboost<=1.0.2
xgboost

0 comments on commit 18c4dc1

Please sign in to comment.