seqme.rank

Contents

seqme.rank#

seqme.rank(df, metrics=None, *, tiebreak=None, ties='auto', name='Rank')[source]#

Calculate the non-dominated rank of each entry using one or more metrics.

If the column already exists, then don’t use it to compute the rank unless explicitly selected in metrics. Rank overrides the column name if it already exists.

References

[1] David Come and Joshua Knowles.

“Techniques for Highly Multiobjective Optimisation: Some Nondominated Points are Better than Others.” https://arxiv.org/pdf/0908.3025.pdf

[2] K. Deb, A. Pratap, S. Agarwal, and T. Meyarivan.

“A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II.”

Note

Deviations are ignored.

Parameters:
  • df (DataFrame) – Metric dataframe.

  • metrics (Optional[list[str]]) – Metrics for dominance-based comparison. If None, use all metrics in dataframe (except the column with the same name if it exists).

  • tiebreak (Optional[Literal['mean-rank', 'crowding-distance']]) –

    How to break ties when the rows have same rank. In some cases, ties may not be resolvable by the selected method. If None, no tie-breaking occurs and ranks correspond to each “peeled” non-dominated set.

    • 'mean-rank':

      Break ties by ranking each metric independently across all rows in the tied group, then averaging those per-metric ranks for each row [1].

    • 'crowding-distance':

      Break ties using the crowding distance within the tied group. Rows with larger crowding distance (i.e., more isolated solutions in metric space) are ranked better [2].

  • ties (Literal['min', 'max', 'mean', 'dense', 'auto']) –

    How to do rank numbering when there are ties.

    • 'min': [1, 2, 2, 4]-ranking

    • 'max': [1, 3, 3, 4]-ranking

    • 'mean': [1, 2.5, 2.5, 4]-ranking

    • 'dense': [1, 2, 2, 3]-ranking

    • 'auto': 'dense' if tiebreak is None else 'min'

  • name (str) – Name of metric.

Return type:

DataFrame

Returns:

A copy of the original dataframe with an extra column indicating the non-dominated rank of each entry.