Created
October 31, 2018 04:59
-
-
Save stasSajin/3e8dc8f2bc55cb70418e66381d50dd68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bias_var = np.array('gender_male') | |
bias_idx = np.argwhere(np.isin(np.array(feature_names), bias_var))[0] | |
interactions[:, bias_idx, :] = 0 | |
interactions[:, :, bias_idx] = 0 | |
y_hat_no_bias = np.exp(interactions.sum(axis = 1).sum(axis = 1)) - 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment