-
Notifications
You must be signed in to change notification settings - Fork 36
Fixes #812 #813
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
Fixes #812 #813
Conversation
for more information, see https://pre-commit.ci
src/dvclive/live.py
Outdated
@@ -664,7 +664,7 @@ def log_sklearn_plot( | |||
raise InvalidPlotTypeError(name) | |||
|
|||
sklearn_kwargs = { | |||
k: v for k, v in kwargs.items() if k not in plot_config or k != "normalized" | |||
k: v for k, v in kwargs.items() if k not in plot_config or k == "normalized" |
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.
k: v for k, v in kwargs.items() if k not in plot_config or k == "normalized" | |
k: v for k, v in kwargs.items() if k not in plot_config |
We don't need any check for normalized here. It's already part of plot_config
, which is all that's needed. We don't want to include it in sklearn_kwargs
since it's purely to set the dvc plots template to confusion_normalized
.
Thanks @ocraft! Ideally, I would like to make
If you are interested, feel free to try this, but I'm fine to merge without that if it's beyond what you want to take on. |
I think that I can do that. Personally, I just expected that log_plot and log_sklearn_plot would have the same arguments; it seemed logical to me. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #813 +/- ##
==========================================
+ Coverage 95.47% 95.52% +0.04%
==========================================
Files 57 57
Lines 3889 3951 +62
Branches 353 353
==========================================
+ Hits 3713 3774 +61
- Misses 124 125 +1
Partials 52 52 ☔ View full report in Codecov by Sentry. |
src/dvclive/live.py
Outdated
sklearn_kwargs = {k: v for k, v in kwargs.items() if k not in plot_config} | ||
plot.step = self.step | ||
plot.dump(val, **sklearn_kwargs) |
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.
sklearn_kwargs = {k: v for k, v in kwargs.items() if k not in plot_config} | |
plot.step = self.step | |
plot.dump(val, **sklearn_kwargs) | |
plot.step = self.step | |
plot.dump(val, **kwargs) |
Since the plot config options are now named args, I don't think it should be necessary to do anything here but pass kwargs
directly.
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.
@ocraft Please see the one comment. If you can ping me once it's ready, it should be good to approve after that. Thanks again!
@dberenbaum Done :) |
Fix for #812