fatf.utils.metrics.subgroup_metrics.performance_per_subgroup_indexed

fatf.utils.metrics.subgroup_metrics.performance_per_subgroup_indexed(indices_per_bin: List[numpy.ndarray], ground_truth: numpy.ndarray, predictions: numpy.ndarray, *args, label_index: int = 0, labels: Optional[List[Union[float, str]]] = None, metric: Optional[str] = None, metric_function: Optional[Callable[[numpy.ndarray], float]] = None, **kwargs) → List[float][source]

Computes a chosen metric per sub-population for index-based grouping.

This function combines fatf.utils.metrics.tools.confusion_matrix_per_subgroup_indexed function together with fatf.utils.metrics.subgroup_metrics.apply_metric (when using metric parameter) and fatf.utils.metrics.subgroup_metrics.apply_metric_function (when using metric_function parameter) functions. For the description of parameters, errors and exceptions please see the documentation of these functions.

Note

The metric_function parameter takes the precedence over the metric parameter is both are provided.

Returns
population_metricsList[numbers]

A list with the value of the selected metric for every sub-population.

bin_namesList[strings]

The name of every sub-population (binning results) defined by the feature ranges for a numerical feature and feature value sets for a categorical feature.