Comments (4)
Hi @userbm ,
In TimeSHAP you can only obtain the event-wise shapley values through the method timeshap.explainer.event_level.event_level
, but this method is currently wrapped by timeshap.explainer.event_level.local_event
which is the one users are supposed to use.
Regarding the methods you mentioned:
timeshap.explainer.pruning.local_pruning()
is responsible for calculating the pruning algorithm values. Once this values are obtained, a pruning index can be calculated by applying the user-defined pruning tolerance.timeshap.explainer.kernel.TimeShapKernel.shap_values()
is responsible for calculating all types of explanations, depending on the explanation mode you provide when creating the TimeShapKernel object.
If you only require standard explanations from TimeSHAP, I would recommend using the following methods: local_pruning, local_event, local_feat, local_cell_level, prune_all, event_explain_all, feat_explain_all
. If you need to use other methods in the package, feel free to ask any questions you may have.
In response to your question about the pruning index, I would need more context to provide a specific answer. In TimeSHAP, the pruning index indicates that all older events (in respect to the index) are to be grouped as to not waste computational power on using them for coalitions and scoring. This index affects the calculated explanations as it as it changes the number of events that are perturbed to compute them.
I hope this answer is helpful. If you have any further questions feel free to ask.
from timeshap.
Hi @userbm ,
You can obtain the contributions for all types of explanations by using the methods to calculate them. They are showcased in our notebook AReM.ipynb. These are: local_pruning, local_event, local_feat, local_cell_level, prune_all, event_explain_all, feat_explain_all
.
Additionally, if you pass the argument "path" in the explanation configuration dictionaries, you can have the contributions being saved on a csv on your local device.
If you have any further questions, don't hesitate to contact us
from timeshap.
Thank you @JoaoPBSousa for the reply. AReM.ipynb was very explanatory.
Going through the code, I find that event-wise shap values can be obtained through either of the following:
1. timeshap.explainer.pruning.local_pruning()
2. timeshap.explainer.kernel.TimeShapKernel.shap_values()
But the values I obtained are slightly different in these two cases. The difference might be because of the pruning index argument in the latter. But I don't understand why the shap values are different with or without pruning index.
Can you tell me why the difference? Or which one is correct, if I understood these incorrectly?
from timeshap.
Thank you @JoaoPBSousa for the detailed reply. This sufficiently answers my doubts.
from timeshap.
Related Issues (20)
- Array indexing with list of strings. HOT 1
- Doubts on provided notebook: dataset format, model configuration HOT 10
- TIMESHAP without pruning HOT 1
- Error ''Score difference between baseline and instance ... is too low < 0.1.'' HOT 2
- local_event report HOT 4
- How does TimeShap handle missing values (NA)? HOT 9
- global_explainer broken? HOT 1
- will it work for Tensorflow HOT 2
- Does the plot demonstrate that when my feature has a high value, the output either increases or decreases, or vice versa? HOT 2
- Can we wrap any other model than RNN like for transformer networks? HOT 2
- BlockRNN for regression
- Import Error: cannot import name 'Kernel' HOT 2
- Circular Importing in ARem_TF.ipynb
- UnicodeEncodeError: 'charmap' codec can't encode character '\u2264' in position 30: character maps to <undefined> HOT 1
- Is timeshap applicable to the DeepAR model of mxnet?
- Function to get expected value HOT 1
- Add LogitLink in timeshapkernel.
- outputs at all time steps?
- About part of input in the next step is the output of current step
- Lack support for shap > 0.42.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 timeshap.