Update my_pages/rashomon_effect.py
Browse files
my_pages/rashomon_effect.py
CHANGED
|
@@ -57,11 +57,11 @@ def render():
|
|
| 57 |
|
| 58 |
#### Rashomon Set Definition
|
| 59 |
rashomon_set_message = """
|
| 60 |
-
|
| 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;
|
| 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("<div style='text-align: center;'>Accuracy: 90%</div>")
|
| 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("<div style='text-align: center;'>Accuracy: 90%</div>")
|
| 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("<div style='text-align: center;'>Accuracy: 90%</div>")
|
| 106 |
if graph_selected=="horizontal":
|
| 107 |
button_click_h = st.button("Choose Model 3", type="primary")
|
| 108 |
else:
|
|
@@ -115,9 +115,9 @@ def render():
|
|
| 115 |
#### Multiplicity Definition
|
| 116 |
if "graph_selected" in st.session_state:
|
| 117 |
multiplicity_message = """
|
| 118 |
-
|
| 119 |
These conflicting predictions are called multiplicity.<br><br>
|
| 120 |
-
Clearly, the choice of model directly impacts individuals!
|
| 121 |
"""
|
| 122 |
st.markdown(
|
| 123 |
f"<div style='text-align:center; color:#c0392b; font-size:20px; margin:14px 0;'>{multiplicity_message}</div>",
|
|
|
|
| 57 |
|
| 58 |
#### Rashomon Set Definition
|
| 59 |
rashomon_set_message = """
|
| 60 |
+
Multiple models achieving similar accuracy, i.e., multiple interpretations of the data, is known as the Rashomon effect.
|
| 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:14px 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("<div style='text-align: center;'>Accuracy: 90%</div>", unsafe_allow_html=True)
|
| 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("<div style='text-align: center;'>Accuracy: 90%</div>", unsafe_allow_html=True)
|
| 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("<div style='text-align: center;'>Accuracy: 90%</div>", unsafe_allow_html=True)
|
| 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, notice the highlighted individual who doesn't get loan, but would have gotten loan under a different model.
|
| 119 |
These conflicting predictions are called 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:14px 0;'>{multiplicity_message}</div>",
|