Comments (3)
Oh maybe I should ask it in the git of shap
from shap-hypetune.
When I use the model.estimator_ to calculate SHAP values, I found that some features corresponds to NaN values, maybe because I used the min_features_to_select option? How can I get the SHAP values used to select the features?
from shap-hypetune.
Hi,
in shap-hypetune, shap values are computed using shap.TreeExplainer with feature_perturbation="tree_path_dependent". shap importances are aggregated featurewise using this aggregation: np.abs(shap_values).mean(0)
. No method is available in shap-hypetune to extract/plot shap importances (since you can directly use the shap library).
To get the shap importances of the selected features, compute the shape values on your data (train or evaluation set using only the selected features) and aggregate them with the calculation np.abs(shap_values).mean(0)
shap-hypetune/shaphypetune/utils.py
Lines 36 to 44 in 47316d3
if u support the project, don't forget to leave a star ;-)
from shap-hypetune.
Related Issues (20)
- Error in BoostBoruta HOT 1
- Any plan to write a publication or preprint.
- Issue with custom scorer HOT 1
- Any chance to extent this amazing tool to Random Forest? HOT 2
- Erratic behaviour HOT 1
- Can BoostBoruta be used in a scikit-pipeline? HOT 4
- ExplainerError HOT 3
- Suppress warnings HOT 4
- K-fold or Blocked cross validation HOT 1
- Eval Metric directionality? HOT 11
- Question: isn't `SelectorMixin` the right sklearn subclass? HOT 5
- 'numpy.random.mtrand.RandomState' object has no attribute 'integers' HOT 4
- Question about SHAP importance HOT 1
- What are some possible reasons that BoostRFA is not running in Parallel?
- Possible to use hyperopts q-distributions? HOT 1
- Issue with hyperopt HOT 2
- How to get feature set along with hyper parameters for each iteration HOT 1
- BoostBoruta always selects different features HOT 3
- Sample weights for training and evaluation 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-hypetune.