Trusted-AI / AIF360

A comprehensive set of fairness metrics for datasets and machine learning models, explanations for these metrics, and algorithms to mitigate bias in datasets and models.
https://aif360.res.ibm.com/
Apache License 2.0
2.46k stars 840 forks source link

Optimized Preprocessing Issue #252

Open MihirMishra23 opened 3 years ago

MihirMishra23 commented 3 years ago

I've been having trouble initializing the Optimized Preprocessing class. According to the AIF360 documentation, the initialization command follows the template OptimPreproc(optimizer, optim_options, unprivileged_groups=None, privileged_groups=None, verbose=False, seed=None). I have tried using OP = preprocessing.OptimPreproc(optimizer=SGD, optim_options={"learning_rate":0.1}, unprivileged_groups=unprivileged_groups, privileged_groups=privileged_groups), with SGD imported from tensorflow.keras.optimizers, but when I call the fit_transform method of OptimPreproc, I get "TypeError: Unexpected keyword argument passed to optimizer: df". The error comes up regardless of what I put for optim_options (even "None"). I have also confirmed that I have passed in the correct parameter when calling fit_transform, as it works for every other preprocessing algorithm. This leads me to believe that there is an issue with the initialization.

Does anyone have any suggestions on how to initialize the OptimPreproc class and use its fit_transform method? Example code would be much appreciated :)