aif360.algorithms.preprocessing
.Reweighing¶
-
class
aif360.algorithms.preprocessing.
Reweighing
(unprivileged_groups, privileged_groups)[source]¶ Reweighing is a preprocessing technique that Weights the examples in each (group, label) combination differently to ensure fairness before classification [4].
References
[4] F. Kamiran and T. Calders, “Data Preprocessing Techniques for Classification without Discrimination,” Knowledge and Information Systems, 2012. Parameters: Methods
fit
Compute the weights for reweighing the dataset. fit_predict
Train a model on the input and predict the labels. fit_transform
Train a model on the input and transform the dataset accordingly. predict
Return a new dataset with labels predicted by running this Transformer on the input. transform
Transform the dataset to a new dataset based on the estimated transformation. -
fit
(dataset)[source]¶ Compute the weights for reweighing the dataset.
Parameters: dataset (BinaryLabelDataset) – Dataset containing true labels. Returns: Reweighing – Returns self.
-
transform
(dataset)[source]¶ Transform the dataset to a new dataset based on the estimated transformation.
Parameters: dataset (BinaryLabelDataset) – Dataset that needs to be transformed. Returns: dataset (BinaryLabelDataset) – - Dataset with transformed
- instance_weights attribute.
-