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
PLT - add visualization of objective as function of stop_val
#479
Conversation
any thoughts @mathurinm? |
Thanks for having a look @Badr-MOUFAD ! I can't see anything for the other objective, is it normal ? How does this handle combination of solvers that use iteration stop_val and tol stop val ? I'd try to find an explicit name for the toggle button, like "plot a function of stopping criterion" but shorter... not easy :) |
@mathurinm, the values of the objective are negative and hence can't be visualized using a log-y scale. |
Actually, it doesn't handle this case and I don't see how we can achieve that (also, I don't find a column in the IMO, plotting as a function of |
Some minor comments after @mathurinm's invitation (to take with a grain of salt):
(Not linked to this PR, but with benchopt the kind of ZigZag pattern that can be observed in the current result plot is not rare and a little bit puzzling) |
Actually, I am not sure we want to add a switch. Also, this would allow to separate WDYT? |
I would like to reiterate that the completion of this PR would be extremely valuable for a lot of us in the community. I also remain adamant that at least on the display html, names should reflect what the user is interested in and not variable names from the codebase i.e. iterations/tolerance and not StoppingCriterion or stop_val. It would be really great as well if we can have integer ticks if x == iterations. Cheers. |
As discussed with @mathurinm IRL, I propose the following solution to move on with this PR:
I would say this looks like a good first step, without adding too much complexity? WDYT @Badr-MOUFAD ? |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #479 +/- ##
==========================================
- Coverage 54.64% 54.58% -0.07%
==========================================
Files 43 43
Lines 2796 2805 +9
Branches 511 514 +3
==========================================
+ Hits 1528 1531 +3
- Misses 1153 1159 +6
Partials 115 115 |
Yes, it sounds good to me. |
030ea2e
to
d673c7b
Compare
@tomMoral, I have a little concern about this point
In fact, we don't store the strategy in the data frame of results and hence we cannot determine the stopping strategy at the plotting stage: One workaround is to add the stopping strategy attribute in Lines 187 to 192 in 1487639
WDYT @tomMoral? Do you see another workaround? |
I would have suggested the same so perfect :) As the dataframe is stored as a parquet (thus compressed), the impact on the output file's size should be minim so works for me. |
With the latter remarks being taken into account here is a preview of the feature. The xaxis type drop menu acts also as a filter: only the solver with a stopping strategy matching xaxis type will be shown. |
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.
LGTM! a few comments but I really like the result, it looks very smooth! thanks a lot @Badr-MOUFAD
the two things to fix:
-
callback
strategy should be mapped toiteration
- the drop down menu should contain only values present in the dataframe
<option value="time">Time</option> | ||
<option value="iteration">Iteration</option> | ||
<option value="tolerance">Tolerance</option> |
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.
can this be parametrized to avoid putting iteration
or tolerance
if it does not exists in the data?
Actually, all these values should come from the ['time'] + list(df['stopping_strategy'].unique())
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.
I opted for dynamically creating the options depending on the selected dataset and objective columns. In fact, some solvers might be skipped in some cases.
Any thoughts?
Very cool work it looks very good !
Overall it's very nice ! |
Thanks, @jeandut for the feedback! Here is the updated preview of the feature. |
I have just become aware that the responsiveness (mobile support) was implemented by duplicating the sidebar's content and styling it separately. benchopt/benchopt/plotting/html/templates/result.mako.html Lines 22 to 25 in d520e74
benchopt/benchopt/plotting/html/templates/result.mako.html Lines 97 to 99 in d520e74
Hence to fix #479 (comment), we should make the same changes we did for the sidebar of the big screen to the one on the mobile screen. Responsiveness is usually implemented through breakpoints that specify the style to be applied according to the screen size. P.S. I updated the feature preview |
Awesome !!! |
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.
Ok, it looks good! Just a small fix for the xticks and 2 nitpicks and we are good to go!
Thx @Badr-MOUFAD !
Thanks a lot for the explanation, indeed it would be much better to implement it with the right synthax. |
Looking at Plotly log scale doc, I don't think it is a bug. |
You are totally right. The tick values do make sense somehow on log-scale. Looks like it's ready to be merged ! Great work ! |
merged, thanks a lot for making this feature @Badr-MOUFAD ! |
This adds a toggle to enable visualizing the objectives as function
stop_val
, namelyn_iter
.Link to a dummy benchmark to preview the feature. (credit to @mathurinm for the idea of the benchmark).
A link to the benchmark repo to reproduce.
PR related to #287