gemseo / algos

# pareto_front module¶

## Compute and display a Pareto Front¶

Classes:

 ParetoPlotBiObjective(axes, obj_values, …) Plot a 2D Pareto front on a Matplotlib axes.

Functions:

 compute_pareto_optimal_points(obj_values[, …]) Compute the Pareto optimal points. generate_pareto_plots(obj_values, obj_names) Plot a 2D Pareto front.
class gemseo.algos.pareto_front.ParetoPlotBiObjective(axes, obj_values, pareto_optimal_loc, obj_names, all_pareto_optimal, is_non_feasible, bi_obj=False, show_non_feasible=True)[source]

Bases: object

Plot a 2D Pareto front on a Matplotlib axes.

Parameters
• axes (matplotlib.axes.Axes) – A matplotlib axes on which to be plotted.

• obj_values (ndarray) – The objective function array, of size (n_samples, n_objs).

• pareto_optimal_loc (Sequence[bool]) – A vector of booleans of size n_samples, True if the point is Pareto optimal.

• obj_names (Sequence[str]) – The names of the objectives.

• all_pareto_optimal (Sequence[bool]) – The indices of points that are Pareto optimal w.r.t. all criteria.

• is_non_feasible (Sequence[bool]) – An Array of booleans of size n_samples, True if non_feasible.

• bi_obj (bool) – True if there are only two objective values.

• show_non_feasible (bool) – True to show the non-feasible points.

Return type

None

Methods:

 Plot the Pareto points on the Matplolib axes.
plot_on_axes()[source]

Plot the Pareto points on the Matplolib axes.

Return type

None

gemseo.algos.pareto_front.compute_pareto_optimal_points(obj_values, feasible_points=None)[source]

Compute the Pareto optimal points.

Search for all the non-dominated points, i.e. there exists j such that there is no lower value for obj_values[:,j] that does not degrade at least one other objective obj_values[:,i].

Parameters
• obj_values (numpy.ndarray) – The objective function array of size (n_samples, n_objs).

• feasible_points (Optional[numpy.ndarray]) – An array of boolean of size n_sample, True if the sample is feasible, False otherwise.

Returns

The vector of booleans of size n_samples, True if the point is Pareto optimal.

Return type

numpy.ndarray

gemseo.algos.pareto_front.generate_pareto_plots(obj_values, obj_names, figsize=(10.0, 10.0), non_feasible_samples=None, show_non_feasible=True)[source]

Plot a 2D Pareto front.

Parameters
• obj_values (numpy.ndarray) – The objective function array of size (n_samples, n_objs).

• obj_names (Sequence[str]) – The names of the objectives.

• figsize (Tuple[float, float]) – The matplotlib figure sizes in x an y directions, in inches.

• non_feasible_samples (Optional[numpy.ndarray]) – The array of bool of size n_samples, True if the current sample is non-feasible. If None, all the samples are considered feasible.

• show_non_feasible (bool) – If True, show the non-feasible points in the Pareto front plot.

Raises

ValueError – If the number of objective values and names are different.

Return type

matplotlib.figure.Figure