Comments (3)
Thanks for the bug report!
On the master branch of shap, I can reproduce the issue above with xgboost == 1.7.6
but not with xgboost == 2.0.0
.
EDIT: It looks like a difference in the loaded tree_limit
:
Lines 389 to 390 in bf2e449
This is then passed to iteration_range
, which replaces the deprecated xgboost parameter ntree_limit
as of #2987 :
Lines 402 to 408 in bf2e449
- with XGBoost
1.7.6
,self.model.tree_limit
is100
. The original model is called withinteration_range=(0, 100)
. - with XGBoost
2.0.0
,self.model.tree_limit
isNone
. The original model is called withiteration_range=(0, 0)
.
The RFRegressor fails with an iteration_range that is higher than 1, presumably because the trees are in parallel. So, I think iteration_range
is not quite a drop-in replacement for ntree_limit
. Perhaps the interation_range
should be something like tree_limit / num_parallel_trees
?
On a side note, it doesn't look like there are any tests for XGBRFRegressor
or XGBRFClassifier
at the moment, so it would be good to explore if shap can officially support them. @trivialfis , do you by any chance know about this history of XGBoost & shap, if there is any particular reason why the XGB RF models are seemingly not already supported / tested by shap?
from shap.
This may be solved by #3462 , which will improve the XGBoost model loading significantly. As a temporary workaround for now, you could try updating to XGBoost 2+ if possible.
from shap.
This should be solved by #3462, and will be released in 0.45.0
.
from shap.
Related Issues (20)
- Provided model function fails when applied to the provided data set.BUG: HOT 2
- BUG: AttributeError when using CatBoost with columns containing special characters
- BUG: Pytorch DeepExplainer SHAP explanations do not sum up to the model's output HOT 3
- BUG:
- BUG: NaN values created flattened Beeswarms HOT 1
- BUG: TreeSHAP Interventional explanations segmentation fault HOT 3
- BUG: Problem of dimension during KernelExplainer HOT 6
- ENH: Not showing nan values on Beeswarm or violin plots
- BUG: Discrepancy among SHAP beeswarm and Seaborn swarmplots
- Intrepreting Siamese Network using SHAP values HOT 5
- ENH: Support SeLU activations for Tensorflow DeepExplainer
- BUG: AssertionError: The SHAP explanations do not sum up to the model's output HOT 1
- [Meta-issue] deprecation tracker for upcoming releases HOT 2
- BUG: missing **dmatrix_props in shape_interaction module HOT 1
- BUG: TreeExplainer ignores "link" argument passed by the Explainer API HOT 1
- BUG: SHAP Partition explainer fails for a single token text input HOT 5
- BUG: Shap value cannot be calculated according to NLP tutorial on the original website HOT 17
- Segmentation Fault on MacOS with pytorch > 2.2.0 HOT 4
- ENH: Faster import performance 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.