gemseo / algos

Show inherited members

pareto_front module

Compute and display a 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.

    By default it is set to False.

  • show_non_feasible (bool) –

    True to show the non-feasible points.

    By default it is set to True.

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 (ndarray) – The objective function array of size (n_samples, n_objs).

  • feasible_points (ndarray | None) – 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:

ndarray

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

Plot a 2D Pareto front.

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

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

  • fig_size (FigSizeType) –

    The matplotlib figure sizes in x and y directions, in inches.

    By default it is set to (10.0, 10.0).

  • non_feasible_samples (ndarray | None) – 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.

    By default it is set to True.

Raises:

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

Return type:

matplotlib.figure.Figure