Shortcuts

SubgroupDifference#

class ignite.metrics.fairness.SubgroupDifference(base_metric, groups, output_transform=<function _SubgroupBase.<lambda>>, device=device(type='cpu'))[source]#

A wrapper metric that computes the maximum difference between any two subgroups’ metric values.

This metric is useful for measuring performance disparities across demographic segments.

Parameters:
  • base_metric (Metric) – an instance of the metric to be computed for each group.

  • groups (Sequence[Any]) – a sequence of unique group identifiers.

  • output_transform (Callable) – a callable that is used to transform the engine output.

  • device (str | device) – specifies the computation device.

New in version 0.5.4.

Methods

compute

Computes the maximum disparity between any two subgroups.

compute()[source]#

Computes the maximum disparity between any two subgroups.

Returns:

The maximum difference (max - min) in metric value across all non-empty subgroups.

Raises:

NotComputableError – if less than two unique subgroups have been processed.

Return type:

float

×

Search Docs