Skip to content
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

Support backend rendering of plots in the top page #805

Merged
merged 7 commits into from
Feb 16, 2024

Conversation

knshnb
Copy link
Member

@knshnb knshnb commented Feb 9, 2024

Contributor License Agreement

This repository (optuna-dashboard) and Goptuna share common code.
This pull request may therefore be ported to Goptuna.
Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.

  • I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

Top page version of #778

What does this implement/fix? Explain your changes.

This PR supports the backend rendering of the following three plots.

  • pareto front
  • history
  • hyperparameter importance
  • timeline
  • intermediate values

We need to discuss how to handle includePruned and logScale args to address history and intermediate values plots.

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (3880129) 69.71% compared to head (ead77a9) 69.53%.
Report is 16 commits behind head on main.

Files Patch % Lines
optuna_dashboard/_app.py 57.14% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #805      +/-   ##
==========================================
- Coverage   69.71%   69.53%   -0.18%     
==========================================
  Files          35       35              
  Lines        2364     2370       +6     
==========================================
  Hits         1648     1648              
- Misses        716      722       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 50 to 56
getPlotAPI(studyId, PlotType.ParamImportances)
.then(({ data, layout }) => {
plotly.react(plotDomId, data, layout)
})
.catch((err) => {
console.error(err)
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid calling the API directly in useEffect, a new hook usePlot has been introduced (optuna_dashboard/ts/hooks/usePlot.ts).
Could you change the implementation to use this? (FYI, see the implementation of optuna_dashboard/ts/components/GraphContour.tsx)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I applied this change: 4ceeb1b

Comment on lines 42 to 43
{" "}
<div id={plotDomId} />{" "}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete {" "}.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you! 9256a1b

@porink0424
Copy link
Collaborator

@knshnb Thank you for your PR!
I left some suggestions to fix.

@knshnb
Copy link
Member Author

knshnb commented Feb 14, 2024

Thanks for the review! I updated the PR.

Copy link
Collaborator

@porink0424 porink0424 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

@c-bata c-bata merged commit 09f61ce into optuna:main Feb 16, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants