AIF360 icon indicating copy to clipboard operation
AIF360 copied to clipboard

AttributeError when using ExponentiatedGradientReduction from aif360.inprocessing

Open jtorsvik opened this issue 2 years ago • 1 comments

I'm trying to use the ExponentiatedGradientReduction-function for my classifier with the following code:

from aif360.algorithms.inprocessing import ExponentiatedGradientReduction as EGR
from sklearn.linear_model import LogisticRegression as logreg

clf = logreg(random_state=1)
EGR(estimator=clf, constraints="EqualizedOdds", drop_prot_attr=False)

(just as explained in the GitHub example of the same code: https://github.com/Trusted-AI/AIF360/blob/master/examples/demo_exponentiated_gradient_reduction.ipynb

But when I run the code I get an error-message saying:

AttributeError: module 'fairlearn.reductions' has no attribute 'TruePositiveRateDifference'

After a little bit of digging in the fairness API I see that the 'TruePositiveRateDifference' refers to a function from the older v.0.4.6, but for the new v.0.7.0 it is no longer included.

Do I have to install the older version of fairlearn to use the EGR-function, if so how do I do that?

jtorsvik avatar May 06 '22 22:05 jtorsvik

Hi there,

#322 should address your issue!

mnagired avatar Aug 03 '22 14:08 mnagired