Update my_pages/rashomon_effect.py
Browse files
my_pages/rashomon_effect.py
CHANGED
|
@@ -61,7 +61,7 @@ def render():
|
|
| 61 |
We call the models below part of a 'Rashomon set'.
|
| 62 |
"""
|
| 63 |
st.markdown(
|
| 64 |
-
f"<div style='text-align:center; color:#c0392b; font-size:20px; margin:
|
| 65 |
unsafe_allow_html=True,
|
| 66 |
)
|
| 67 |
|
|
@@ -80,7 +80,7 @@ def render():
|
|
| 80 |
col1, col2, col3, col4, col5 = st.columns([0.5, 1, 1, 1, 0.5])
|
| 81 |
with col2:
|
| 82 |
st.pyplot(plot_scatter(income, credit, colors, boundary_type="vertical", highlight_point=highlight_point))
|
| 83 |
-
st.markdown("
|
| 84 |
if graph_selected=="vertical":
|
| 85 |
button_click_v = st.button("Choose Model 1", type="primary")
|
| 86 |
else:
|
|
@@ -91,7 +91,7 @@ def render():
|
|
| 91 |
st.rerun()
|
| 92 |
with col3:
|
| 93 |
st.pyplot(plot_scatter(income, credit, colors, boundary_type="slant", highlight_point=highlight_point))
|
| 94 |
-
st.markdown("
|
| 95 |
if graph_selected=="slant":
|
| 96 |
button_click_s = st.button("Choose Model 2", type="primary")
|
| 97 |
else:
|
|
@@ -102,7 +102,7 @@ def render():
|
|
| 102 |
st.rerun()
|
| 103 |
with col4:
|
| 104 |
st.pyplot(plot_scatter(income, credit, colors, boundary_type="horizontal", highlight_point=highlight_point))
|
| 105 |
-
st.markdown("
|
| 106 |
if graph_selected=="horizontal":
|
| 107 |
button_click_h = st.button("Choose Model 3", type="primary")
|
| 108 |
else:
|
|
@@ -115,11 +115,11 @@ def render():
|
|
| 115 |
#### Multiplicity Definition
|
| 116 |
if "graph_selected" in st.session_state:
|
| 117 |
multiplicity_message = """
|
| 118 |
-
Because of your choice,
|
| 119 |
-
These conflicting predictions
|
| 120 |
<b>Clearly, the choice of model directly impacts individuals!</b>
|
| 121 |
"""
|
| 122 |
st.markdown(
|
| 123 |
-
f"<div style='text-align:center; color:#c0392b; font-size:20px; margin:
|
| 124 |
unsafe_allow_html=True,
|
| 125 |
)
|
|
|
|
| 61 |
We call the models below part of a 'Rashomon set'.
|
| 62 |
"""
|
| 63 |
st.markdown(
|
| 64 |
+
f"<div style='text-align:center; color:#c0392b; font-size:20px; margin:0 0;'>{rashomon_set_message}</div>",
|
| 65 |
unsafe_allow_html=True,
|
| 66 |
)
|
| 67 |
|
|
|
|
| 80 |
col1, col2, col3, col4, col5 = st.columns([0.5, 1, 1, 1, 0.5])
|
| 81 |
with col2:
|
| 82 |
st.pyplot(plot_scatter(income, credit, colors, boundary_type="vertical", highlight_point=highlight_point))
|
| 83 |
+
st.markdown("Accuracy: 90%")
|
| 84 |
if graph_selected=="vertical":
|
| 85 |
button_click_v = st.button("Choose Model 1", type="primary")
|
| 86 |
else:
|
|
|
|
| 91 |
st.rerun()
|
| 92 |
with col3:
|
| 93 |
st.pyplot(plot_scatter(income, credit, colors, boundary_type="slant", highlight_point=highlight_point))
|
| 94 |
+
st.markdown("Accuracy: 90%")
|
| 95 |
if graph_selected=="slant":
|
| 96 |
button_click_s = st.button("Choose Model 2", type="primary")
|
| 97 |
else:
|
|
|
|
| 102 |
st.rerun()
|
| 103 |
with col4:
|
| 104 |
st.pyplot(plot_scatter(income, credit, colors, boundary_type="horizontal", highlight_point=highlight_point))
|
| 105 |
+
st.markdown("Accuracy: 90%")
|
| 106 |
if graph_selected=="horizontal":
|
| 107 |
button_click_h = st.button("Choose Model 3", type="primary")
|
| 108 |
else:
|
|
|
|
| 115 |
#### Multiplicity Definition
|
| 116 |
if "graph_selected" in st.session_state:
|
| 117 |
multiplicity_message = """
|
| 118 |
+
Because of your choice, the highlighted individual was rejected, but would have gotten loan under a different model.
|
| 119 |
+
These conflicting predictions is multiplicity.<br><br>
|
| 120 |
<b>Clearly, the choice of model directly impacts individuals!</b>
|
| 121 |
"""
|
| 122 |
st.markdown(
|
| 123 |
+
f"<div style='text-align:center; color:#c0392b; font-size:20px; margin:0 0;'>{multiplicity_message}</div>",
|
| 124 |
unsafe_allow_html=True,
|
| 125 |
)
|