langfair.metrics.classification.metrics.predicted_prevalence.PredictedPrevalenceRateParity#
- class langfair.metrics.classification.metrics.predicted_prevalence.PredictedPrevalenceRateParity#
Bases:
Metric
- __init__()#
This class computes predicted prevalence rate parity. The user may specify whether to compute this metric as a difference or a ratio.
Methods
__init__
()This class computes predicted prevalence rate parity.
binary_confusion_matrix
(y_true, y_pred)evaluate
(groups, y_pred[, y_true, ratio])This method computes disparity in predicted prevalence rates between two groups.
- evaluate(groups, y_pred, y_true=None, ratio=False)#
This method computes disparity in predicted prevalence rates between two groups.
- Parameters:
groups (Array-like) – Group indicators. Must contain exactly two unique values.
y_pred (Array-like) – Binary model predictions. Positive and negative predictions must be 1 and 0, respectively.
y_true (Array-like, default=None) – Binary labels (ground truth values). This argument is only a placeholder for this class.
ratio (bool, default=False) – Indicates whether to compute the metric as a difference or a ratio
- Returns:
Value of predicted prevalence rate parity
- Return type:
float