fatf.utils.metrics.subgroup_metrics.performance_per_subgroup

fatf.utils.metrics.subgroup_metrics.performance_per_subgroup(dataset, ground_truth, predictions, column_index, *args, label_index=0, groupings=None, numerical_bins_number=5, treat_as_categorical=None, labels=None, metric=None, metric_function=None, **kwargs)[source]

Computes a chosen metric per sub-population for a data set.

This function combines fatf.utils.metrics.tools.confusion_matrix_per_subgroup 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.

Examples using fatf.utils.metrics.subgroup_metrics.performance_per_subgroup