aif360.algorithms.postprocessing.EqOddsPostprocessing¶
-
class
aif360.algorithms.postprocessing.EqOddsPostprocessing(unprivileged_groups, privileged_groups, seed=None)[source]¶ Equalized odds postprocessing is a post-processing technique that solves a linear program to find probabilities with which to change output labels to optimize equalized odds [8] [9].
References
[8] M. Hardt, E. Price, and N. Srebro, “Equality of Opportunity in Supervised Learning,” Conference on Neural Information Processing Systems, 2016. [9] G. Pleiss, M. Raghavan, F. Wu, J. Kleinberg, and K. Q. Weinberger, “On Fairness and Calibration,” Conference on Neural Information Processing Systems, 2017. Parameters: Methods
fitCompute parameters for equalizing odds using true and predicted labels. fit_predictfit and predict methods sequentially. fit_transformTrain a model on the input and transform the dataset accordingly. predictPerturb the predicted labels to obtain new labels that satisfy equalized odds constraints. transformReturn a new dataset generated by running this Transformer on the input. -
fit(dataset_true, dataset_pred)[source]¶ Compute parameters for equalizing odds using true and predicted labels.
Parameters: - true_dataset (BinaryLabelDataset) – Dataset containing true labels.
- pred_dataset (BinaryLabelDataset) – Dataset containing predicted labels.
Returns: EqOddsPostprocessing – Returns self.
-
predict(dataset)[source]¶ Perturb the predicted labels to obtain new labels that satisfy equalized odds constraints.
Parameters: - dataset (BinaryLabelDataset) – Dataset containing labels that needs to be transformed.
- dataset – Transformed dataset.
-