The objective range of Matplotlib contour plot has a different numerical range from Plotly backend
See original GitHub issueExpected behavior
The range of objective in optuna.visualization.matplotlib.plot_contour
should have a similar range to optuna.visualization.plot_contour
.
Environment
- Optuna version: 2.7.0
- Python version: 3.8.8
- OS: Mac
- (Optional) Other libraries and their versions:
- matplotlib: 3.3.4
- Plotly: 4.11.0
Error messages, stack traces, or logs
The matplotlib range is from -60 000
to 360 000
as in the following figure.
On the other hand, Plotly’s range is from 0
to 9 000
. That is supposed to be true.
Steps to reproduce
- Please run a following example code blocks
Reproducible examples (optional)
import optuna
def objective(trial):
x = trial.suggest_uniform('x', -100, 100)
y = trial.suggest_categorical('y', list(range(-10, 10)))
z = trial.suggest_uniform('z', -100, 100)
return x ** 2 + y - z
study = optuna.create_study(sampler=optuna.samplers.TPESampler(seed=7))
study.optimize(objective, n_trials=200)
optuna.visualization.matplotlib.plot_contour(study, params=['y', 'z'])
optuna.visualization.plot_contour(study, params=['y', 'z']) # plotly
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Contour plots in Python - Plotly
A 2D contour plot shows the contour lines of a 2D numerical array z , i.e. interpolated lines of isovalues of z ....
Read more >Contour Plots using Plotly in Python - GeeksforGeeks
A contour plot has a function of two variables of curves along which the function has constant values so that these curves join...
Read more >Chapter 4. Visualization with Matplotlib - O'Reilly
We can see that this scatter plot has given us the ability to simultaneously explore four different dimensions of the data: the (x,...
Read more >Plotting with Plotly — hvPlot 0.8.2 documentation
This page demonstrates the use of the Plotly plotting backend, ... example here we will plot the departure delay ('depdelay') as a function...
Read more >Data Visualization(2D/3D): 35+ Exercises - Kaggle
Depending on what backends you have installed, many different file formats ... Adjusting the Plot: Axes Limits # Matplotlib does a decent job...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Brilliant! Thank you for sharing your investigation. It sounds great – reviewers can understand the change in the pull request smoothly.
I was reading 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 works in the same way, so we can just use that if we go for linear interpolation. Let me know your thoughts…