aif360.sklearn.metrics.specificity_score

aif360.sklearn.metrics.specificity_score(y_true, y_pred, *, pos_label=1, sample_weight=None, zero_division='warn')[source]

Compute the specificity or true negative rate.

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

  • y_pred (array-like) – Estimated targets as returned by a classifier.

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

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

  • zero_division ('warn', 0 or 1) – Sets the value to return when there is a zero division. If set to “warn”, this acts as 0, but warnings are also raised.