-
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
New @metric decorator #505
base: main
Are you sure you want to change the base?
Conversation
modelskill/metrics.py
Outdated
|
||
|
||
def metric(best: str | None = None, has_units: bool = False): | ||
"""Decorator to attach a 'best' attribute to metric functions.""" |
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.
update docstring with all 3 functionality
I wonder if we could use the same decorator concept to handle the aliasing concept in metrics 🤔 right now it is confusing that we have e.g. mae and mean_absolute_error which is the same thing. In a list of available metrics they should not appear as two separate entries and I guess in practice one would never user mean_absolute_error as it would be clumsy in a table. Maybe we could instead have a long_name attribute on mae or display_name on the long one or something. I guess it would be better to postpone this to a future PR though... |
TODO:
_one_is_best_metrics = ["lin_slope"]
_zero_is_best_metrics = ["bias"] |
No description provided.