Skip to content

Conversation

@iwan-tee
Copy link
Collaborator

Added filtration and helper function what aims to make the interface more user-friendly

@iwan-tee iwan-tee requested a review from mirand863 April 15, 2024 10:49
@iwan-tee iwan-tee marked this pull request as ready for review April 15, 2024 18:12
# Specify additional filters to obtain only level 0
shap_filter = {"level": 0, "class": "Respiratory", "sample": respiratory_idx}
# Filter samples which only predicted "Respiratory"
respiratory_idx = explainer.get_sample_indices(predictions, "Respiratory")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about making it more pandas-like? For example respiratory_idx = predictions == "Respiratory"?


# Use .sel() method to apply the filter and obtain filtered results
shap_val_respiratory = explanations.sel(shap_filter)
shap_val_respiratory = explainer.filter_by_class(
Copy link
Collaborator

@mirand863 mirand863 Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, I guess you can probably call the method get_sample_indices inside this other method filter_by_class, simplifying it for the user

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

settled in this option for now

@iwan-tee
Copy link
Collaborator Author

should I be aware of all time queued tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants