multiobjective.Metric

multiobjective.Metric(
    column,
    direction='lower_better',
    target=None,
    label=None,
    unit='',
    as_percentage=False,
    decimals=1,
    phrasing=None,
)

Describes how one column in the solutions dataframe should be treated when comparing solutions.

Used in two places: compute_pareto_front() and friends, where a list of these describes a multi-objective trade-off; and solve(rank_on=...), where a single one names the metric the search itself should optimise.

column: name of the column in the solutions dataframe direction: “higher_better” (e.g. coverage), “lower_better” (e.g. average travel time), or “closest_to_target” (e.g. an inter-tertile ratio where 1.0 = perfectly even, and both >1 and <1 represent moving away from equity in different directions) target: required if direction == “closest_to_target” label: human-readable name, defaults to a title-cased column name

Attributes

Name Description
as_percentage bool(x) -> bool
decimals int([x]) -> integer
direction str(object=’’) -> str
unit str(object=’’) -> str

Methods

Name Description
format_delta Render an absolute change in this metric for stakeholder-facing text.
format_value Render a single value of this metric for stakeholder-facing text.
normalise Return a version of this metric where lower is always better.
phrase Full clause describing a change in this metric, e.g.
Back to top