Skip to content

Commit

Permalink
Added support for LightGBM and XGBoost boosters
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed May 24, 2024
1 parent 14c210a commit b367f26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sklearn2pmml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ def _joblib_dump(obj, prefix):
return path

def _is_supported(estimator):
clazz = estimator.__class__
# LightGBM and XGBoost Booster objects
if clazz.__module__.split(".")[0] in ["lightgbm", "xgboost"] and clazz.__name__ == "Booster":
return True
# H2O Estimator objects
if hasattr(estimator, "download_mojo"):
return True
return isinstance(estimator, BaseEstimator)
Expand Down

0 comments on commit b367f26

Please sign in to comment.