filmov
tv
python shap , how to fix, raise ExceptionThe passed model is not callable and cannot be analyzed di
![preview_player](https://i.ytimg.com/vi/xDo_HJj1pck/maxresdefault.jpg)
Показать описание
C extension was not built during install!
Traceback (most recent call last):
explainer = shap.Explainer(model, background_adult) # bug
raise Exception("The passed model is not callable and cannot be analyzed directly with the given masker! Model: " + str(model))
Exception: The passed model is not callable and cannot be analyzed directly with the given masker! Model: XGBClassifier(base_score=0.5, booster='gbtree', colsample_bylevel=1,
colsample_bynode=1, colsample_bytree=1, gamma=0, gpu_id=-1,
importance_type='gain', interaction_constraints='',
learning_rate=0.300000012, max_delta_step=0, max_depth=2,
min_child_weight=1, missing=nan, monotone_constraints='()',
n_estimator=100, n_estimators=100, n_jobs=2, num_parallel_tree=1,
random_state=0, reg_alpha=0, reg_lambda=1, scale_pos_weight=1,
subsample=1, tree_method='exact', validate_parameters=1,
verbosity=None)
Model coefficients:
CRIM = -0.108
ZN = 0.0464
INDUS = 0.0206
CHAS = 2.6867
NOX = -17.7666
RM = 3.8099
AGE = 0.0007
DIS = -1.4756
RAD = 0.306
TAX = -0.0123
PTRATIO = -0.9527
B = 0.0093
LSTAT = -0.5248
Permutation explainer: 507it [00:21, 14.63it/s]
Permutation explainer: 507it [00:18, 12.11it/s]
Permutation explainer: 1001it [00:36, 20.61it/s]
Permutation explainer: 1001it [00:39, 18.97it/s]
divide by zero encountered in log
divide by zero encountered in log
The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].
Parameters: { n_estimator } might not be used.
This may not be accurate due to some parameters are only used in language bindings but
passed down to XGBoost core. Or some parameters are not used but slip through this
verification. Please open an issue if you find above cases.
Permutation explainer: 32562it [26:10, 20.54it/s]
Traceback (most recent call last):
explainer = shap.Explainer(model, background_adult) # bug
raise Exception("The passed model is not callable and cannot be analyzed directly with the given masker! Model: " + str(model))
Exception: The passed model is not callable and cannot be analyzed directly with the given masker! Model: XGBClassifier(base_score=0.5, booster='gbtree', colsample_bylevel=1,
colsample_bynode=1, colsample_bytree=1, gamma=0, gpu_id=-1,
importance_type='gain', interaction_constraints='',
learning_rate=0.300000012, max_delta_step=0, max_depth=2,
min_child_weight=1, missing=nan, monotone_constraints='()',
n_estimator=100, n_estimators=100, n_jobs=2, num_parallel_tree=1,
random_state=0, reg_alpha=0, reg_lambda=1, scale_pos_weight=1,
subsample=1, tree_method='exact', validate_parameters=1,
verbosity=None)
Model coefficients:
CRIM = -0.108
ZN = 0.0464
INDUS = 0.0206
CHAS = 2.6867
NOX = -17.7666
RM = 3.8099
AGE = 0.0007
DIS = -1.4756
RAD = 0.306
TAX = -0.0123
PTRATIO = -0.9527
B = 0.0093
LSTAT = -0.5248
Permutation explainer: 507it [00:21, 14.63it/s]
Permutation explainer: 507it [00:18, 12.11it/s]
Permutation explainer: 1001it [00:36, 20.61it/s]
Permutation explainer: 1001it [00:39, 18.97it/s]
divide by zero encountered in log
divide by zero encountered in log
The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].
Parameters: { n_estimator } might not be used.
This may not be accurate due to some parameters are only used in language bindings but
passed down to XGBoost core. Or some parameters are not used but slip through this
verification. Please open an issue if you find above cases.
Permutation explainer: 32562it [26:10, 20.54it/s]
Комментарии