aif360.metrics.utils
.compute_num_pos_neg¶
-
aif360.metrics.utils.
compute_num_pos_neg
(X, y, w, feature_names, label, condition=None)[source]¶ Compute the number of positives, \(P\), or negatives, \(N\), optionally conditioned on protected attributes.
Parameters: - X (numpy.ndarray) – Dataset features.
- y (numpy.ndarray) – Label vector.
- w (numpy.ndarray) – Instance weight vector.
- feature_names (list) – Names of the features.
- label (float) – Value of label (unfavorable/positive or unfavorable/negative).
- condition (list(dict)) – Same format as
compute_boolean_conditioning_vector()
.
Returns: int – Number of positives/negatives (optionally conditioned)