Comments (4)
This issue also exists for objective="count:poisson"
from shap.
using xgboost (2.0.3) and shap (0.45), I get the following error trace. It seems like it might be related to the same issue.
AttributeError Traceback (most recent call last)
Cell In[32], line 2
1 # Create the SHAP explainer with the model
----> 2 explainer = shap.TreeExplainer(fit_xgb)
4 # Compute SHAP values for the training set
5 shap_values = explainer.shap_values(preprocessed_data)
File c:\n\venv\Lib\site-packages\shap\explainers_tree.py:195, in TreeExplainer.init(self, model, data, model_output, feature_perturbation, feature_names, approximate, link, linearize_link)
193 self.feature_perturbation = feature_perturbation
194 self.expected_value = None
–> 195 self.model = TreeEnsemble(model, self.data, self.data_missing, model_output)
196 self.model_output = model_output
197 #self.model_output = self.model.model_output # this allows the TreeEnsemble to translate model outputs types by how it loads the model
File c:\n\venv\Lib\site-packages\shap\explainers_tree.py:1063, in TreeEnsemble.init(self, model, data, data_missing, model_output)
1061 elif safe_isinstance(model, “xgboost.core.Booster”):
1062 self.original_model = model
-> 1063 self._set_xgboost_model_attributes(
1064 data,
1065 data_missing,
1066 objective_name_map,
1067 tree_output_name_map,
1068 )
1069 elif safe_isinstance(model, “xgboost.sklearn.XGBClassifier”):
…
-> 1873 self.base_score = np.log(self.base_score)
1874 else:
1875 self.base_score = base_score
AttributeError: ‘XGBTreeModelLoader’ object has no attribute ‘base_score’
from shap.
I am having the same bug for v0.45.0 using the cox loss. Downgrading to v0.44.1 is a temporary solution.
from shap.
Same issue here shap == 0.45.0, pls fix it ASAP! really need it to explain a survival:aft model
from shap.
Related Issues (20)
- When will the paddlepaddle framework be supported HOT 1
- BUG: LookupError: gradient registry has no entry for: shap_TensorListStack HOT 2
- BUG: shap summary plot for 3 group classification HOT 1
- ENH: Include directionality of feature association in beeswarm plot
- ENH: Support SeLU and activation function in Pytorch Deep Explainer
- BUG: tensorflow DeepExplainer SHAP explanations do not sum up to the model's output HOT 1
- Question: Using SHAP with GPT-4 via API HOT 2
- BUG: Warning: unrecognized nn.Module: Chomp1d HOT 2
- CI broken: mistralai Mistral-7B-v0.1 Tokenizer no longer accessible
- BUG: summary_plot ignores plot_type for TreeExplainer HOT 1
- BUG: TypeError: waterfall() got an unexpected keyword argument 'features' HOT 1
- BUG: Unexpected Interaction Plot Instead of Summary Plot in Multiclass SHAP Summary with XGBoost HOT 3
- BUG: Workflow failure on macOS when building 'lightgbm'
- ENH: expose raw feature categories in shap.plots.bar HOT 1
- ENH: Winter Values HOT 3
- [Meta-issue] Release 0.45.1 HOT 5
- BUG: [in version 0.44.0 and 0.45.0] UserWarning: unrecognized nn.Module: Flatten HOT 1
- BUG: 'tuple' object has no attribute 'as_list' HOT 3
- BUG: unable to use SHAP with CUDA support on Windows10/11 machine for calculating Shapley values HOT 1
- Support for KerasClassifier HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shap.