File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1- from functools import partial
21import re
2+ import warnings
3+ from functools import partial
34from typing import Any , Optional , Pattern , Union
45
56import numpy as np
67import scipy .sparse as sp
8+ import xgboost
79from xgboost import (
810 XGBClassifier ,
911 XGBRegressor ,
@@ -147,6 +149,11 @@ def explain_prediction_xgboost(
147149 changes from parent to child.
148150 Weights of all features sum to the output score of the estimator.
149151 """
152+ if not xgboost .__version__ .startswith (('0.' , '1.' )):
153+ warnings .warn (
154+ 'This explanation might be incoorrect, '
155+ 'only xgboost < 2.0.0 is known to work correctly' )
156+
150157 booster , is_regression = _check_booster_args (xgb , is_regression )
151158 xgb_feature_names = _get_booster_feature_names (booster )
152159 vec , feature_names = handle_vec (
You can’t perform that action at this time.
0 commit comments