ibm / infairness Goto Github PK
View Code? Open in Web Editor NEWPyTorch package to train and audit ML models for Individual Fairness
Home Page: https://ibm.github.io/inFairness
License: Apache License 2.0
PyTorch package to train and audit ML models for Individual Fairness
Home Page: https://ibm.github.io/inFairness
License: Apache License 2.0
include default values but expose all parameters to the end users for all classes and methods.
retiring adults dataset: https://github.com/zykls/folktables
Currently, the Logistic Regression metric requires the complete data (with protected attributes) as input along with protected indices. This should be changed to accepting the datasets without protected attributes as X
and the protected attributes data as Y
Google Colab currently provides Python 3.7 (bug) which inFairness does not support. Binder supports specifying python versions.
Hi,
TypeError Traceback (most recent call last)
Input In [10], in <cell line: 8>()
5 distance_x = distances.LogisticRegSensitiveSubspace()
6 distance_y = distances.SquaredEuclideanDistance()
----> 8 distance_x.fit(X_train, protected_idxs)
9 distance_y.fit(num_dims=output_size)
11 distance_x.to(device)
File /srv/conda/envs/notebook/lib/python3.8/site-packages/inFairness/distances/logistic_sensitive_subspace.py:77, in LogisticRegSensitiveSubspace.fit(self, data_X, data_SensitiveAttrs, protected_idxs, keep_protected_idxs, autoinfer_device)
42 """Fit Logistic Regression Sensitive Subspace distance metric
43
44 Parameters
(...)
73 on CPU.
74 """
76 if data_SensitiveAttrs is not None and protected_idxs is None:
---> 77 basis_vectors_ = self.compute_basis_vectors_data(
78 X_train=data_X, y_train=data_SensitiveAttrs
79 )
81 elif data_SensitiveAttrs is None and protected_idxs is not None:
82 basis_vectors_ = self.compute_basis_vectors_protected_idxs(
83 data_X,
84 protected_idxs=protected_idxs,
85 keep_protected_idxs=keep_protected_idxs,
86 )
File /srv/conda/envs/notebook/lib/python3.8/site-packages/inFairness/distances/logistic_sensitive_subspace.py:164, in LogisticRegSensitiveSubspace.compute_basis_vectors_data(self, X_train, y_train)
161 X_train = datautils.convert_tensor_to_numpy(X_train)
162 y_train = datautils.convert_tensor_to_numpy(y_train)
--> 164 self.assert_sensitiveattrs_binary(y_train)
166 basis_vectors_ = []
167 outdim = y_train.shape[-1]
File /srv/conda/envs/notebook/lib/python3.8/site-packages/inFairness/distances/logistic_sensitive_subspace.py:185, in LogisticRegSensitiveSubspace.assert_sensitiveattrs_binary(self, sensitive_attrs)
183 def assert_sensitiveattrs_binary(self, sensitive_attrs):
--> 185 assert validationutils.is_tensor_binary(
186 sensitive_attrs
187 ), "Sensitive attributes are required to be binary to learn the metric. Please binarize these attributes before fitting the metric."
File /srv/conda/envs/notebook/lib/python3.8/site-packages/inFairness/utils/validationutils.py:19, in is_tensor_binary(data)
5 """Checks if the data is binary (0/1) or not. Return True if it is binary data
6
7 Parameters
(...)
15 True if data is binary. False if not
16 """
18 nonbindata = (data != 0) & (data != 1)
---> 19 has_nonbin_data = True in nonbindata
20 return not has_nonbin_data
TypeError: argument of type 'bool' is not iterable
Geomloss has a build problem and right now we are pointing to a fork.
paper link: https://arxiv.org/abs/2103.11023
Also, the output prediction should include the rankings, not only the scores
Travis CI builds terminating citing: "Job has been terminated due to insufficient credits balance". Investigate migrating to GitHub actions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.