Skip to content

Commit 4f18f0f

Browse files
update feature importance explaination
1 parent 4a467d3 commit 4f18f0f

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

shapash/webapp/utils/callbacks.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -857,11 +857,7 @@ def adjust_figure_layout(figure: Figure) -> None:
857857
MyGraph.adjust_graph_static(figure, x_ax="Mean absolute Contribution")
858858
figure.layout.clickmode = "event+select"
859859

860-
try:
861-
y_values = figure.data[0].y
862-
# Convert all y labels to strings before measuring their lengths
863-
nb_car = max(len(str(y)) for y in y_values if y is not None)
864-
figure.update_layout(yaxis=dict(tickfont={"size": min(round(500 / nb_car), 12)}))
865-
except Exception as e:
866-
# Optional: log or print an error message for debugging
867-
print(f"Warning: Could not adjust figure layout properly: {e}")
860+
y_values = figure.data[0].y
861+
# Convert all y labels to strings before measuring their lengths
862+
nb_car = max(len(str(y)) for y in y_values if y is not None)
863+
figure.update_layout(yaxis=dict(tickfont={"size": min(round(500 / nb_car), 12)}))

shapash/webapp/utils/explanations.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,12 @@ def __init__(self):
6363
*individual contributions*,
6464
computed on the complete dataset.
6565
You can click on each feature to update
66-
the detailed contribution plot below. \n
67-
In case of grouped the variables (based on the "features_groups"
68-
parameter),
66+
the detailed contribution plot below.\n
67+
When displaying the **Global Feature Importance** chart in full-screen mode,
68+
the visualization also includes the **Local Feature Importance** view,
69+
allowing you to explore both global and local contributions interactively.\n
70+
71+
In case of grouped variables (based on the *"features_groups"* parameter),
6972
the group detail is available by clicking on the grouped variable
7073
(displayed in dark orange).
7174
"""

0 commit comments

Comments
 (0)