Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COFRNET - Minor fixes on binary incompatibility of numpy/pandas by pinning numpy version and explainer #197

Merged
merged 3 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aix360/algorithms/cofrnet/CoFrNet.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def explain(self, explain_mode, max_layer_num = 10, var_num = 6):
var_num: For "print_co_fr": Variable (index of input feature) for Which to Display Ladder, Default 6
'''

def importances(self):
def importances():
final_layer_weights = vars(self.model.layers[-1])['_parameters']['weight'].data.numpy()
weights_by_node = final_layer_weights.T
averaged = np.average(weights_by_node, axis = 1)
Expand All @@ -144,7 +144,7 @@ def importances(self):
#print(vars(self.model.layers[-1])['_parameters']['weight'].data.numpy().T)


def print_co_fr(self, max_layer_num = 10, var_num = 6):
def print_co_fr(max_layer_num = 10, var_num = 6):
#max_layer_num = chosen depth of ladder to show (10 layers, index would be 9)
#var_num = variable for which to display ladder
thingToPrint = ""
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
],
"cofrnet": [
"pandas<2.0.0",
"numpy==1.24.2",
"torch",
"tqdm",
],
Expand Down
Loading