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

[Dependencies] module 'numpy' has no attribute 'float'. #505

Closed HuangruiChu closed 10 months ago

HuangruiChu commented 11 months ago

np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

When I run the code to test with German Dataset, I run into above error.

HuangruiChu commented 11 months ago

It seems because the version of AIF360 I installed using "pip install aif360" is different thant current version we have in Github. I just check the code here https://github.com/Trusted-AI/AIF360/blob/master/aif360/algorithms/preprocessing/optim_preproc_helpers/data_preproc_functions.py#L268

This should not cause the above error.

PrimozGodec commented 10 months ago

I believe it can be solved with a new release, which was already requested long ago, but we got no response: https://github.com/Trusted-AI/AIF360/issues/500.