fairlearn.metrics.selection_rate#

fairlearn.metrics.selection_rate(y_true, y_pred, *, pos_label=1, sample_weight=None)[source]#

Calculate the fraction of predicted labels matching the ‘good’ outcome.

The argument pos_label specifies the ‘good’ outcome. For consistency with other metric functions, the y_true argument is required, but ignored.

Read more in the User Guide.

Return type:

float

Parameters:
y_truearray_like

The true labels (ignored)

y_predarray_like

The predicted labels

pos_labelScalar

The label to treat as the ‘good’ outcome

sample_weightarray_like

Optional array of sample weights