Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Use weights in Permutation Feature Importance calculation #563

Closed
danielarifmurphy opened this issue Apr 29, 2024 · 1 comment
Closed
Labels
feature 💡 New feature or enhancement request Python 🐍 Related to Python

Comments

@danielarifmurphy
Copy link
Contributor

Hi Dalex team - great job on the package!

I am looking to use sample weights when using PFI. Whilst we can pass weights to the Explainer, it is not currently used in the loss calculation at each permutation round.

Could we open up the loss_function to take sample weights as optional argument?

@hbaniecki hbaniecki added feature 💡 New feature or enhancement request Python 🐍 Related to Python labels May 4, 2024
hbaniecki pushed a commit that referenced this issue May 5, 2024
…on (#564)

* Pass explainer weights to loss_after_permutation

* Define weights for sampled data

* Function to handle loss functions with or without sample_weight arg

* Replace loss function calls with wrapper

* Add imports

* Avoid ambiguous truth values

* More explicit warning if weights passed but not used in loss calc
@hbaniecki
Copy link
Member

Thank you for contributing to dalex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 💡 New feature or enhancement request Python 🐍 Related to Python
Projects
None yet
Development

No branches or pull requests

2 participants