-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(l2gmodel): store features list metadata as instance attribute #979
Conversation
… the hub metadata
…-l2g-feature-list-injection
…entargets/gentropy into il-l2g-feature-list-injection
@@ -5,7 +5,7 @@ ci: | |||
autofix_commit_msg: "chore: pre-commit auto fixes [...]" | |||
repos: | |||
- repo: https://github.com/astral-sh/ruff-pre-commit | |||
rev: v0.9.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it the artifact from the .pre-commit update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To sum up of what I understood:
The feature_list
is derived from the config.json
file generated for the model in the repository.
This is a correct approach from what I can read from the skops package documentation. The only inconvenience is (as you have mentioned), when someone wants to use the older model, then they must provide the features list to use.
Two additional points:
- This is a great approach, moreover I would also allow the user to add the
config.json
in the skops format, since they are responsible for running the model predictions, hence they should make sure that the feature_list is correct. - Not sure if it already is in the place but, make sure that all of the features are in the FM and in correct order provided by the user (or metadata).
I wonder if we could make an update to the skops to allow for referencing model by the commit. Mayby it is a good time to make this as a suggestion in the issue ?
I can take a look in free time next week.
Ty for the comments!
That would be nice, but loading a model that is not downloaded from the Hub would still have the issue. I think that your suggestion of adding a model metadata when we dump the model is good! |
✨ Context
The list of features that the L2G model has been trained on is a crucial part of the model metadata. The order in which those features have to be passed to be model is also important and shall be maintained so that L2G produces accurate results.
To accomplish this, I've added a new instance attribute
features_list
to theLocusToGeneModel
class. Any method that needs this information will fetch it now from the model's metadata, not from the step config.This is to avoid incompatibilities between the list of features provided in the package config and older versions of the model.
This PR was motivated by an issue observed in #939
🛠 What does this PR implement
LocusToGeneModel.features_list
as instance attribute.features_list
parameter from the config is then used:🙈 Missing
🚦 Before submitting
dev
branch?make test
)?uv run pre-commit run --all-files
)?