Make `plot_contour` example more pedagogical
See original GitHub issueMotivation
Examples in the API reference should be pedagogical. The plot for the contour plot is not with somewhat poorly visible categorical parameter values.
Description
The contour plot example could use a better suited objective function e.g. limited to floats. The following code was provided by @toshihikoyanase . Maybe we can modify it to only suggest 2 variables to keep it simple and use it here.
def objective(trial):
x = trial.suggest_float("x", 0, 1)
y = trial.suggest_float("y", 0, 1)
z = trial.suggest_float("z", 0, 1)
return (x - 0.5) ** 2 + (y - 0.2) ** 2 + (z - 0.7) ** 2
- Update example code.
- Update example image generation script.
- Run the script from 2. to generate a new image.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Teach Your Students to Draw Contour Lines
Teaching contour line is a simple way to hone students' observational drawing skills, preparing them for more advanced drawing activities to ...
Read more >Contour Basics: JAVA Mac PC - SERC - Carleton
The Contour Activity (more info) is a great on-line resource for introducing students to contour plots. The lessons:.
Read more >Contour plot of matrix - MATLAB contour - MathWorks
This MATLAB function creates a contour plot containing the isolines of matrix Z, where Z contains height values on the x-y plane.
Read more >How to Create a Contour Plot in Matplotlib
Example 1 – Draw a simple contour plot. Let's use the matplotlib.pyplot.contour() function to create a simple contour plot. import numpy as np....
Read more >Nonlinear Programming Contour Map Optimization - YouTube
A contour plot of the objective and constraints is useful in exploring the feasible region (potential solutions) and boundaries for a simple ...
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 FreeTop 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
Top GitHub Comments
Addressing the visibility for categorical samples in the first place might be an issue in itself but this is probably less straight forward since we cannot compute distances between categorical values.
Edit: this is an issue for
suggest_int
values as well. We might want to consider creating some padding after all.Thank you @hvy, and let me share my notebook that draws the contour plot using the above objective function.