question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stabilize `plot_pareto_front`

See original GitHub issue

(Updated on January 26, 2022)

Motivation

Stable API of multi-objective optimization has been available since Optuna v2.4.0, but the visualization for multi-objective optimization, i.e., optuna.visualization.plot_pareto_front and optuna.visualization.matplotlib.plot_pareto_front, is still experimental.

We have following two issues:

  1. many-objective optimization support
  2. constrained-optimization support

This issue mainly describes the first issue since the second issue is tracked in https://github.com/optuna/optuna/issues/3116.

Many-objective optimization support

The current plot_pareto_front is designed for 2 or 3 objective optimization. It does not accept more than 3 objectives. Before stabilizing the plot_pareto_front, I’d like to discuss how to provide support for more than 3 objectives since it may need breaking change in interface.

Currently, the function raises errors when studies, and users cannot see trade-off relationship. I guess even a part of trade-off relationship can be useful for users to choose trials. For example, the following plots are the visualization of Pareto-front of the result of four objective optimization (minimization):

Objective 0 vs Objective 1 image

Objective 1 vs Objective 2 image

Objective 2 vs Objective 3 image

The red dots are the Pareto solutions in four dimensional objective space. Unlike two-objective optimization, we cannot see the whole Pareto front in a single figure, but we can see low-dimensional projection of Pareto front in each plot. It sometimes useful, for instance, when users have priorities in objective values.

Design

Some visualization functions including plot_contour and plot_optimization_history have the target argument to select the values to display. We can follow the convention to choose the objective values. plot_pareto_front expects two or three values, so the argument name should be targets. The signature and the example input are as follows:

# Signature
targets: Optional[Callable[[FrozenTrial], Sequence[float]]]

# Example 1. Objective 0 vs Objective 1
targets=lambda t: (t.values[0], t.values[1])

# Example 2. Objective 2 vs Objective 1 vs Objective 0
targets=lambda t: (t.values[2], t.values[1], t.values[0])

# Example 3. This is not a conventional Pareto-front, but we can visualize the relationship between parameter and objectives
targets=lambda t: (t.params["x"], t.values[0], t.values[1])

As can be seen in the example 2, targets covers the functionality of axis_order, and we can remove the axis_order in a future. To keep backward compatibility, we can keep the axis_order, but targets and axis_order are not supposed to be used at once for simplicity.

Tasks

The task are as follows:

  • Add targets argument
  • Deprecate axis_order argument
  • Update optuna.visualization.plot_pareto_front according to optuna.visualization.matplotlib.plot_pareto_front
  • ~Feedback from early-bird users~
  • Remove experimental decorator

(Note that we’d like to stabilize optuna.visualization.plot_pareto_front first, then optuna.visualization.matplotlib.plot_pareto_front will follow it.)

Alternative (Not V3 task)

As shown in some research papers, parallel coordinates plot seems to be widely used to visualize many objective optimization results. I think we can extend plot_parallel_coordinate or create a new plot function for such visualization.

image (excerpted from A benchmark test suite for evolutionary many-objective optimization)

Related issues

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
hvycommented, Oct 31, 2021

📝 Verified on Google Colab that there were no issues. Both the Plotly and the matplotlib backends, with both 2 and 3 objectives rendered as expected.

2reactions
shu65commented, Feb 27, 2022

I’m implementing the feature of this issue with matplotlib.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generate and Plot Pareto Front - MATLAB & Simulink
This example shows how to generate and plot a Pareto front for a 2-D multiobjective function using fgoalattain . The two objective functions...
Read more >
Pareto front for different setups of trial spaces defined in ...
We propose a goal-oriented mesh-adaptive algorithm for a finite element method stabilized via residual minimization on dual discontinuous-Galerkin norms. By ...
Read more >
optuna.visualization.plot_pareto_front - Read the Docs
The following code snippet shows how to plot the Pareto front of a study. import optuna def objective(trial): x = trial.suggest_float("x", 0, ...
Read more >
EXPLICIT PARETO FRONT OPTIMIZATION - OpenReview
works seek to stabilize this optimization by approximating the reward and cost functions ... When we plot learned Pareto fronts for the tasks...
Read more >
A self-driving laboratory advances the Pareto front for material ...
Useful materials must satisfy multiple objectives, where the optimization of one objective is often at the expense of another. The Pareto ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found