-
Notifications
You must be signed in to change notification settings - Fork 415
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
MetricTracker of a single metric should not accept a list of maximize
#1428
Labels
Comments
ValerianRey
added
bug / fix
Something isn't working
help wanted
Extra attention is needed
labels
Jan 6, 2023
good catch, would you be interested in sending a fix? 🐰 |
Yes, I coded a fix already, just need to make a proper pull request! |
I'm also curious about why we use a |
ValerianRey
added a commit
to ValerianRey/metrics
that referenced
this issue
Jan 6, 2023
* Add test case to `test_raises_error_on_wrong_input` to check that the initialization of a MetricTracker with a single `metric` and a list `maximize` raises a ValueError
ValerianRey
added a commit
to ValerianRey/metrics
that referenced
this issue
Jan 6, 2023
* Add check on maximize to be a singe bool when the metric is a single Metric
ValerianRey
added a commit
to ValerianRey/metrics
that referenced
this issue
Jan 6, 2023
4 tasks
Borda
pushed a commit
that referenced
this issue
Jan 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug
It can be confusing that MetricTracker can be instantiated with a single metric and still accept a list of booleans as
maximize
. Further, when callingtracker.best_metric
, the metric will always be maximized whenmaximize
is a list andmetric
is a single Metric (even ifmaximize
is[False]
), which is clearly not an expected behavior (the reason for this comes from those two lines inMetricTracker
'sbest_metric
method:Here, if
self.maximize
is any list, the condition will be True.Raising an error at initialization in such a scenario would be safer.
To Reproduce
Initialize a
MetricTracker
with a single metric asmetric
and a list of booleans asmaximize
.Code sample
=> The metric has been maximized despite
maximize
being[False]
Expected behavior
Raising a
ValueError
at the initialization ofMetricTracker
, indicating thatmaximize
should be a singlebool
when themetric
is a singleMetric
.Environment
Additional context
With the additional support of
MultioutputWrapper
that I am working on (#1409) this becomes even more confusing, because aMultioutputWrapper
is a singleMetric
and a user could be tempted to give a list of booleans asmaximize
.The text was updated successfully, but these errors were encountered: