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:
- 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
Gallery examples#
MetricFrame visualizations
Basics & Model Specification of AdversarialFairnessClassifier
Basics & Model Specification of AdversarialFairnessClassifier
GridSearch with Census Data
Fine Tuning ad AdversarialFairnessClassifier
Fine Tuning ad AdversarialFairnessClassifier
Metrics with Multiple Features
Metrics with Multiple Features
Credit Loan Decisions