Skip to content

Commit

Permalink
correction of the shap explainer and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
qnater committed Sep 25, 2024
1 parent b2abe47 commit 95b67de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions imputegap/explainer/explainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ def convert_results(tmp, file, algo, descriptions, features, categories, mean_fe
:param categories: Category of each feature
:param mean_features: Mean values of each feature
:param to_save : path to save results
:return: Perfect diplay for SHAP result
:return: Perfect display for SHAP result
"""
result_display, display_details, result_shap = [], [], []
result_display, result_shap = [], []
for x, rate in enumerate(tmp):
if math.isnan(rate) == False:
if not math.isnan(rate):
rate = float(round(rate, 2))

result_display.append((x, algo, rate, descriptions[0][x], features[0][x], categories[0][x], mean_features[x]))
Expand Down
Binary file modified tests/assets/shap/chlorine_cdrec_shap_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 95b67de

Please sign in to comment.