You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result is that for xgboost we end up with a sklearn API model, whereas for lightgbm we end up with the raw Booster. The latter does not have a predict_proba method (for classifiers), hence infer_output='predict_proba is not supported.
Solutions
microsoft/LightGBM#4841 suggests that lightgbm sklearn api models can (should?) be saved/loaded via joblib. We could add joblib.load support for when the model artefact's suffix is .joblib.
Alternatively, we could implement something similar to our xgboost implementation. However, converting a Booster to a sklearn api model involves accessing private attributes so might be brittle.
Related
See discussion here #1279 (comment). SKLearn api models (or models with predict_proba) are required for the white-box explainers such as TreeShap.
The text was updated successfully, but these errors were encountered:
Issue
The
mlserver_xgboost
runtime loads models as follows:MLServer/runtimes/xgboost/mlserver_xgboost/xgboost.py
Lines 24 to 34 in 6864a2d
Whilst the
mlserver_lightgbm
runtime does:MLServer/runtimes/lightgbm/mlserver_lightgbm/lightgbm.py
Line 22 in 6864a2d
The result is that for xgboost we end up with a sklearn API model, whereas for lightgbm we end up with the raw
Booster
. The latter does not have apredict_proba
method (for classifiers), henceinfer_output='predict_proba
is not supported.Solutions
microsoft/LightGBM#4841 suggests that
lightgbm
sklearn api models can (should?) be saved/loaded viajoblib
. We could addjoblib.load
support for when the model artefact's suffix is.joblib
.Alternatively, we could implement something similar to our xgboost implementation. However, converting a
Booster
to a sklearn api model involves accessing private attributes so might be brittle.Related
See discussion here #1279 (comment). SKLearn api models (or models with
predict_proba
) are required for the white-box explainers such asTreeShap
.The text was updated successfully, but these errors were encountered: