aif360.sklearn.metrics.base_rate

aif360.sklearn.metrics.base_rate(y_true, y_pred=None, *, pos_label=1, sample_weight=None)[source]

Compute the base rate, \(Pr(Y = \text{pos_label}) = \frac{P}{P+N}\).

Parameters:
  • y_true (array-like) – Ground truth (correct) target values.

  • y_pred (array-like, optional) – Estimated targets. Ignored.

  • pos_label (scalar, optional) – The label of the positive class.

  • sample_weight (array-like, optional) – Sample weights.

Returns:

float – Base rate.