Skip to content

Commit f2cfa26

Browse files
committed
Update template explainability.
1 parent 6c3e4e6 commit f2cfa26

File tree

1 file changed

+51
-34
lines changed

1 file changed

+51
-34
lines changed
Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,65 @@
11
{% if labels|length > 1 %}
2-
{% with menuId='dropdownMenuLabel', menuText='Response', values=labels, menuDivVisible='explain-all' %}
3-
{% include "dropdown.html" %}
4-
{% endwith %}
2+
{% with menuId='dropdownMenuLabel', menuText='Response', values=labels, menuDivVisible='explain-all' %}
3+
{% include "dropdown.html" %}
4+
{% endwith %}
55
{% else %}
66
{% endif %}
77
<h3 data-toc-skip>Global feature importance plot</h3>
88
{% for label in labels %}
9-
<div class="row" id="explain-all-div-{{ label['name'] }}" style="{% if label['index'] != 0 %}display:none;{% endif %} margin-right:5px; margin-left:5px; margin-top:5px;">
10-
{{ label['feature_importance_plot'] }}
11-
</div>
9+
<div class="row" id="explain-all-div-{{ label['name'] }}"
10+
style="{% if label['index'] != 0 %}display:none;{% endif %} margin-right:5px; margin-left:5px; margin-top:5px;">
11+
{{ label['feature_importance_plot'] }}
12+
</div>
1213
{% endfor %}
1314
<h3>Features contribution plots</h3>
1415
{% for label in labels %}
15-
<div class="row" id="explain-all-div-{{ label['name'] }}-2" style="{% if label['index'] != 0 %}display:none;{% endif %} margin-right:5px; margin-left:5px; margin-top:5px;">
16-
{% with menuId='dropdownMenu2', menuText='Feature', values=label['features'], menuDivVisible='explain-contrib-'~label['index'] %}
17-
{% include "dropdown.html" %}
18-
{% endwith %}
19-
{% for col in label['features'] %}
20-
<div class="row" id="explain-contrib-{{ label['index'] }}-div-{{ col['name'] }}" style="{% if col['feature_index'] != 0 %}display:none;{% endif %} margin-right:5px; margin-left:5px;">
21-
<h4>{{ col['name'] }} - {{ col['type'] }}</h4>
22-
{% if col['name'] != col['description'] %}
23-
<blockquote class="panel-content">{{ col['description'] }}</blockquote>
24-
{% else %}
25-
{% endif %}
26-
{{ col['plot'] }}
27-
</div>
28-
{% endfor %}
16+
<div class="row" id="explain-all-div-{{ label['name'] }}-2"
17+
style="{% if label['index'] != 0 %}display:none;{% endif %} margin-right:5px; margin-left:5px; margin-top:5px;">
18+
{% with menuId='dropdownMenu2', menuText='Feature', values=label['features'],
19+
menuDivVisible='explain-contrib-'~label['index'] %}
20+
{% include "dropdown.html" %}
21+
{% endwith %}
22+
{% for col in label['features'] %}
23+
<div class="row" id="explain-contrib-{{ label['index'] }}-div-{{ col['name'] }}"
24+
style="{% if col['feature_index'] != 0 %}display:none;{% endif %} margin-right:5px; margin-left:5px;">
25+
<h4>{{ col['name'] }} - {{ col['type'] }}</h4>
26+
{% if col['name'] != col['description'] %}
27+
<blockquote class="panel-content">{{ col['description'] }}</blockquote>
28+
{% else %}
29+
{% endif %}
30+
{{ col['plot'] }}
2931
</div>
32+
{% endfor %}
33+
</div>
3034
{% endfor %}
35+
{% set has_interaction = false %}
36+
{% for label in labels %}
37+
{% if label['features_interaction']|length > 0 %}
38+
{% set has_interaction = true %}
39+
{% endif %}
40+
{% endfor %}
41+
42+
{% if has_interaction %}
3143
<h3>Features Top Interaction plots</h3>
3244
{% for label in labels %}
33-
<div class="row" id="explain-all-div-interaction-{{ label['name'] }}-2" style="{% if label['index'] != 0 %}display:none;{% endif %} margin-right:5px; margin-left:5px; margin-top:5px;">
34-
{% with menuId='dropdownMenu3', menuText='Interactions', values=label['features_interaction'], menuDivVisible='explain-contrib-interaction-'~label['index'] %}
35-
{% include "dropdown.html" %}
36-
{% endwith %}
37-
{% for col in label['features_interaction'] %}
38-
<div class="row" id="explain-contrib-interaction-{{ label['index'] }}-div-{{ col['name'] }}" style="{% if col['feature_index'] != 0 %}display:none;{% endif %} margin-right:5px; margin-left:5px;">
39-
<h4>{{ col['name'] }} - {{ col['type'] }}</h4>
40-
{% if col['name'] != col['description'] %}
41-
<blockquote class="panel-content">{{ col['description'] }}</blockquote>
42-
{% else %}
43-
{% endif %}
44-
{{ col['plot'] }}
45-
</div>
46-
{% endfor %}
45+
{% if label['features_interaction']|length > 0 %}
46+
<div class="row" id="explain-all-div-interaction-{{ label['name'] }}-2"
47+
style="{% if label['index'] != 0 %}display:none;{% endif %} margin-right:5px; margin-left:5px; margin-top:5px;">
48+
{% with menuId='dropdownMenu3', menuText='Interactions', values=label['features_interaction'],
49+
menuDivVisible='explain-contrib-interaction-'~label['index'] %}
50+
{% include "dropdown.html" %}
51+
{% endwith %}
52+
{% for col in label['features_interaction'] %}
53+
<div class="row" id="explain-contrib-interaction-{{ label['index'] }}-div-{{ col['name'] }}"
54+
style="{% if col['feature_index'] != 0 %}display:none;{% endif %} margin-right:5px; margin-left:5px;">
55+
<h4>{{ col['name'] }} - {{ col['type'] }}</h4>
56+
{% if col['name'] != col['description'] %}
57+
<blockquote class="panel-content">{{ col['description'] }}</blockquote>
58+
{% endif %}
59+
{{ col['plot'] }}
4760
</div>
61+
{% endfor %}
62+
</div>
63+
{% endif %}
4864
{% endfor %}
65+
{% endif %}

0 commit comments

Comments
 (0)