question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add n_samples argument to FeaturePermutation like it exists in ShapleyValueSampling

See original GitHub issue

🚀 Feature

~Add n_samples argument for all perturbation based methods like it exists in ShapleyValueSampling.~ Add n_samples argument to FeaturePermutation like it exists in ShapleyValueSampling.

Motivation

~Perturbation based algorithms~ FeaturePermutation computes feature attribution by perturbing input features. So, depending in how is perturbed, feature attribution varies. To make a more robust estimation, perturbations should happen several times. For example, scikit-learn feature permutation function repeats permutation 5 times by default.

Finally, it’d be consistent with ShapleyValueSampling.

Pitch

~Implement n_samples argument for other perturbation algorithm in addition than ShapleyValueSampling.~ Implement n_samples argument FeaturePermutation.

Alternatives

Do it manually by subclassing every algorithm (FeaturePermutation, ~FeatureAblation and Occlusion~) and overriding attribute method. Then, the new attribution method would call several times the base implementations and average the results.

Additional context

EDIT: change n_samples feature request to only FeaturePermutation as it doesn’t make sense in FeatureAblation and Occlusion algorithms.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
hal-314commented, Nov 2, 2020

@vivekmig Rereading again FeatureAblation and Occlusion, I think you are right and n_samples argument doesn’t make sense. I mainly used FeaturePermutation. As FeatureAblation and Occlusion were part of the same family (perturbation algorithms), I jumped to the conclusions and assume that they’d benefit from n_samples. Sorry for the misunderstanding.

For FeaturePermutation, I think this definitely makes sense and is something we could look into.

That’s nice!

EDIT: tag the right person, sorry vishwakftw!

1reaction
vishwakftwcommented, Oct 29, 2020

@hal-314, you seem to have tagged the wrong person. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature Permutation
A perturbation based approach to compute attribution, which takes each input feature, permutes the feature values within a batch, and computes the difference ......
Read more >
TorchEsegeta: Framework for Interpretability and ...
The framework builds on existing interpretability and explainability techniques that are currently focusing on classification models, ...
Read more >
Model interpretability and Understanding for Pytorch - Morioh
Captum is a model interpretability and understanding library for PyTorch. Captum means comprehension in Latin and contains general purpose implementations ...
Read more >
A Comprehensive Benchmark using Time Series ...
Due to the lack of evaluations of the existing ap- ... Also, aspects like the dependency on gradient cal- ... FeaturePermutation (Fisher et...
Read more >
Polynomial calculation of the Shapley value based on ...
One first samples a random permutation of training data, ... based technique is the Shapley Value Sampling (Castro et al., 2009) .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found