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

chore(l2g): make shap optional #1012

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

chore(l2g): make shap optional #1012

wants to merge 2 commits into from

Conversation

ireneisdoomed
Copy link
Contributor

@ireneisdoomed ireneisdoomed commented Mar 3, 2025

✨ Context

In order to evaluate the latest model, I want to run the predictions step without extracting SHAPs.

I've tested this works in this job.

🛠 What does this PR implement

  • Adds explain_predictions (set to False by default) as a parameter to the L2G step

🙈 Missing

🚦 Before submitting

  • Do these changes cover one single feature (one change at a time)?
  • Did you read the contributor guideline?
  • Did you make sure to update the documentation with your changes?
  • Did you make sure there is no commented out code in this PR?
  • Did you follow conventional commits standards in PR title and commit messages?
  • Did you make sure the branch is up-to-date with the dev branch?
  • Did you write any new necessary tests?
  • Did you make sure the changes pass local tests (make test)?
  • Did you make sure the changes pass pre-commit rules (e.g uv run pre-commit run --all-files)?

@ireneisdoomed ireneisdoomed marked this pull request as ready for review March 3, 2025 16:45
@ireneisdoomed ireneisdoomed changed the title Il optional shap chore(l2g): make shap optional Mar 3, 2025
@@ -292,9 +295,11 @@ def run_predict(self) -> None:
hf_token=access_gcp_secret("hfhub-key", "open-targets-genetics-dev"),
download_from_hub=self.download_from_hub,
)
if self.explain_predictions:
predictions = predictions.explain()
predictions.filter(f.col("score") >= self.l2g_threshold).add_features(
Copy link
Contributor

Choose a reason for hiding this comment

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

Honest question. Can we calculate shap values after filtering ?

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

Successfully merging this pull request may close these issues.

2 participants