aif360.sklearn.metrics.mdss_bias_score

aif360.sklearn.metrics.mdss_bias_score(y_true, probas_pred, X=None, subset=None, *, pos_label=1, scoring='Bernoulli', overpredicted=True, penalty=1e-17, **kwargs)[source]

Compute the bias score for a prespecified group of records using a given scoring function.

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

  • probas_pred (array-like) – Probability estimates of the positive class.

  • X (DataFrame, optional) – The dataset (containing the features) that was used to predict probas_pred. If not specified, the subset is returned as indices.

  • subset (dict, optional) – Mapping of column names to list of values. Samples are included in the subset if they match any value in each of the columns provided. If X is not specified, subset may be of the form {'index': [0, 1, ...]} or None. If None, score over the full set (note: penalty is irrelevant in this case).

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

  • scoring (str or class) – One of ‘Bernoulli’ or ‘BerkJones’ or subclass of aif360.metrics.mdss.ScoringFunctions.ScoringFunction.

  • overpredicted (bool) – Flag for which direction to scan: True means we scan for a group whose expectations/predictions are systematically higher than observed. In other words, we scan for a group whose observed is systematically lower than the expectations. False means we scan for a group whose expectations/predictions are systematically lower than observed (observed is systematically higher than the expectations).

  • privileged (bool) – Deprecated. Use overpredicted instead.

  • penalty (scalar) – Penalty coefficient. Should be positive. The higher the penalty, the less complex (number of features and feature values) the highest scoring subset that gets returned is.

  • **kwargs – Additional kwargs to be passed to scoring (not including direction).

Returns:

float – Bias score for the given group.

See also

mdss_bias_scan()