IBM / ensure-loan-fairness-aif360

A demonstration of the AI Fairness 360 toolbox for bias metrics, explanations, and remediation. Code Pattern: https://developer.ibm.com/patterns/ensuring-fairness-when-processing-loan-applications
Apache License 2.0
28 stars 25 forks source link

Not able to run because of library compatible issue #23

Closed ragudiko closed 5 years ago

ragudiko commented 5 years ago

I get below error when importing libraries RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb

stevemar commented 5 years ago

@ragudiko are you running this on watson studio or locally? also, what version of python are you using?

ragudiko commented 5 years ago

@stevemart : When I run in watson studio-->notebook, I get this error. When I import same notebook into local(anaconda/virtual environment) it runs successfully. But I have one observation in local machine Which I raised to research team here. The below code execution gives different value -0.136480 instead of 0.001276. I am executing notebook locally after cloning github repo.

metric_transf_train = BinaryLabelDatasetMetric(dataset_transf_train, unprivileged_groups=unprivileged_groups, privileged_groups=privileged_groups) display(Markdown("#### Transformed training dataset")) print("Difference in mean outcomes between unprivileged and privileged groups = %f" % metric_transf_train.mean_difference())

ragudiko commented 5 years ago

@stevemart : I just got belowupdate from Kala Kannan(kalapriya.kannan@in.ibm.com) email copy: I checked with Karthikeyan(knatesa@us.ibm.com). Looks like specifically this algorithms uses a random seed and because of this the notebook demo might have an issue. His advice is to use a different algorithm if it is going to be notebook and this has to be handled by having more partitions.

scottdangelo commented 5 years ago

@ragudiko I have started with a new project and notebook in Watson studio, using Default Python 3.5 kernel, and I cannot reproduce your error. Can you tell me which cell you ran that produced the Runtime Error?

ragudiko commented 5 years ago

ai-fairness-library-issue

I am just using default configuration option.

scottdangelo commented 5 years ago

Try using a python kernel without Spark, please. Also, can you cut and paste (not screenshot) the entire stack trace?

ragudiko commented 5 years ago

Thanks Scott, I can run notebook without errors once I chose python kernel without Spark as suggested by you. Why it fails when used the first default option- python with spark? It will be good to mention right option in code pattern.

But the difference in mean outcomes between unprivileged and privileged groups = -0.013180 is not the expected value mentioned in code pattern.

ragudiko commented 5 years ago

We use same python 3.5 version with spark or without spark then how does library version differ when used with spark?

scottdangelo commented 5 years ago

That would be a question for someone in Watson Studio. Watson Studio provides various environments, and the internal implementations, libraries, and details are not something I know about.

scottdangelo commented 5 years ago

Solution is to use Python 3.5 kernel environment with Watson Studio, not the Spark kernel.