File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
- from functools import partial
2
1
import re
2
+ import warnings
3
+ from functools import partial
3
4
from typing import Any , Optional , Pattern , Union
4
5
5
6
import numpy as np
6
7
import scipy .sparse as sp
8
+ import xgboost
7
9
from xgboost import (
8
10
XGBClassifier ,
9
11
XGBRegressor ,
@@ -147,6 +149,11 @@ def explain_prediction_xgboost(
147
149
changes from parent to child.
148
150
Weights of all features sum to the output score of the estimator.
149
151
"""
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
+
150
157
booster , is_regression = _check_booster_args (xgb , is_regression )
151
158
xgb_feature_names = _get_booster_feature_names (booster )
152
159
vec , feature_names = handle_vec (
You can’t perform that action at this time.
0 commit comments