Skip to content

Changed interpolation type to make numeric range consistent with Plotly#2712

Merged
himkt merged 1 commit intooptuna:masterfrom
01-vyom:numeric-range-2595
Jun 9, 2021
Merged

Changed interpolation type to make numeric range consistent with Plotly#2712
himkt merged 1 commit intooptuna:masterfrom
01-vyom:numeric-range-2595

Conversation

@01-vyom
Copy link
Copy Markdown
Contributor

@01-vyom 01-vyom commented May 31, 2021

Motivation

The range of objective in optuna.visualization.matplotlib.plot_contour should have a similar range to optuna.visualization.plot_contour.

Description of the changes

I read the provided link for interpolation of irregular space data and tried the CubicInterpolation code [interpolating z], still got the same results (incorrect numeric range). The Linear interpolation and the option linear in the griddata function work and corrects the numeric range as well, in the same way, so I went with linear interpolation.

Before_Cubic_Interpolation:
Before_Cubic

After_Linear_Interpolation:
After_Linear

Plotly Results:
plotly

As for the colour scale, I have addressed that issue in this PR: #2711

Final Results after colour scale and interpolation correction after merging both the PRs:
Final_Result

closes #2595

@github-actions github-actions bot added the optuna.visualization Related to the `optuna.visualization` submodule. This is automatically labeled by github-actions. label May 31, 2021
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #2712 (2482021) into master (12abe69) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2712   +/-   ##
=======================================
  Coverage   91.67%   91.68%           
=======================================
  Files         140      140           
  Lines       11538    11539    +1     
=======================================
+ Hits        10578    10579    +1     
  Misses        960      960           
Impacted Files Coverage Δ
optuna/visualization/matplotlib/_contour.py 79.67% <ø> (ø)
optuna/integration/allennlp.py 88.17% <0.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12abe69...2482021. Read the comment docs.

Copy link
Copy Markdown
Member

@nzw0301 nzw0301 left a comment

Choose a reason for hiding this comment

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

Thank you for giving comprehensive examples. Looks great to me!

@Crissman
Copy link
Copy Markdown
Contributor

Crissman commented Jun 1, 2021

@c-bata Can you give your thoughts on this?

@c-bata
Copy link
Copy Markdown
Member

c-bata commented Jun 4, 2021

@Crissman Could you unassign me? I need to work on the review of optuna-dashboard project for a while.

@hvy hvy unassigned c-bata Jun 9, 2021
@hvy
Copy link
Copy Markdown
Member

hvy commented Jun 9, 2021

Probably got slipped away, I just unassigned you @c-bata. And thanks for checking.

@hvy
Copy link
Copy Markdown
Member

hvy commented Jun 9, 2021

I quickly went through the previous discussions and it basically sounds good to me but @himkt could you double check?

Cc. @ytknzw if you have any thoughts.

@hvy hvy assigned himkt Jun 9, 2021
Copy link
Copy Markdown
Member

@himkt himkt left a comment

Choose a reason for hiding this comment

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

Thank you for tackling the issue. Let me approve.
I confirmed the range of objective values is corrected.
(Although we may still have to sophisticate the interpolation algorithm, it is another point.)

For further development, I think there is room to improve xrange and yrange of the plot.
The data point near (y, z) = (-10, -100) appears in the plotly's output but not in matplotlib's.

matplotlib plotly

@himkt himkt added this to the v2.9.0 milestone Jun 9, 2021
@himkt himkt merged commit 5de4589 into optuna:master Jun 9, 2021
@ytknzw
Copy link
Copy Markdown
Contributor

ytknzw commented Jun 9, 2021

@01-vyom Thank you for improving my implementation! LGTM!

@himkt The point (-10, -100) is at the very left bottom corner of the plot. It would be due to the difference between interpolation algorithms of matplotlib and ploty.

@01-vyom 01-vyom deleted the numeric-range-2595 branch June 9, 2021 13:42
@hvy hvy added the enhancement Change that does not break compatibility and not affect public interfaces, but improves performance. label Jul 30, 2021
@hvy hvy changed the title BUG: Changed interpolation type to make numeric range consistant with plotly Changed interpolation type to make numeric range consistant with plotly Jul 30, 2021
@hvy hvy changed the title Changed interpolation type to make numeric range consistant with plotly Changed interpolation type to make numeric range consistent with Plotly Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Change that does not break compatibility and not affect public interfaces, but improves performance. optuna.visualization Related to the `optuna.visualization` submodule. This is automatically labeled by github-actions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The objective range of Matplotlib contour plot has a different numerical range from Plotly backend

8 participants