polarities_for
cards.polarities_for(metric_ids, registry=None)
Look up the polarity string for each metric id, in order.
The facade beam.mcda.run takes a list of polarity strings, one per column of the score matrix. This helper builds that list from the cards, so it matches them.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
metric_ids |
Sequence[str] | Ordered list of metric ids matching the columns of the score matrix. | required |
registry |
Registry | None | Optional registry instance. Defaults to a fresh registry over the bundled metrics/ directory. | None |
Returns
| Type | Description |
|---|---|
| list of str | One polarity string per metric id, in the same order. |
Examples
>>> from beam.cards import polarities_for
>>> polarities_for(["ari", "runtime"])
['higher_is_better', 'lower_is_better']