check_solution_equity

site.SiteSolutionSet.check_solution_equity(
    solution_rank=1,
    return_plot=False,
    interactive=True,
    title='default',
    show_average=True,
    plot_solution_metric_as_line='weighted_average',
    rank_on=None,
    ax=None,
    colour_mode=None,
)

Summarise and optionally plot equity metrics for a selected solution.

This method computes the mean minimum cost (min_cost) grouped by the configured equity category for a given solution. It can return either the aggregated data or a visualisation using Plotly (interactive) or Matplotlib (static).

Parameters

Name Type Description Default
solution_rank int Rank of the solution to evaluate (1-indexed). 1
return_plot bool If True, return a plot instead of the summary DataFrame. False
title str Title for the plot. If “default”, a title is generated automatically. "default"
show_average bool If True, display the overall average of min_cost as a horizontal dotted line on the plot. True
rank_on str or None Column name used to rank solutions before selecting the specified solution_rank. If None, the existing order is used. None
interactive bool If True, return an interactive Plotly figure. If False, return a Matplotlib figure. True
ax matplotlib.axes.Axes or None Existing Matplotlib axes to plot on when interactive=False. If None, a new figure and axes are created. None

Returns

Name Type Description
pandas.DataFrame or plotly.graph_objs._figure.Figure or matplotlib.figure.Figure If return_plot=False, returns a DataFrame with mean min_cost per equity group. Otherwise, returns a Plotly or Matplotlib figure depending on the interactive flag.

Notes

  • The equity grouping column is defined by self.site_problem._equity_data_equity_col.
  • The plotted metric is the mean of min_cost within each group.
  • When using Matplotlib with a provided ax, the plot is drawn onto the supplied axes and the corresponding figure is returned.
Back to top