Update my_pages/rashomon_effect.py
Browse files
my_pages/rashomon_effect.py
CHANGED
|
@@ -45,18 +45,18 @@ def render():
|
|
| 45 |
# Decision boundary
|
| 46 |
if boundary_type is not None:
|
| 47 |
if boundary_type == "vertical":
|
| 48 |
-
ax.axvline(65, color='blue'
|
| 49 |
ax.fill_betweenx(np.arange(min(y), max(y)), 65, max(x), alpha=0.1, color='green')
|
| 50 |
ax.fill_betweenx(np.arange(min(y), max(y)), min(x), 65, alpha=0.1, color='red')
|
| 51 |
elif boundary_type == "horizontal":
|
| 52 |
-
ax.axhline(650, color='blue'
|
| 53 |
ax.fill_between(np.arange(min(x), max(x)), 650, max(y), alpha=0.1, color='green')
|
| 54 |
ax.fill_between(np.arange(min(x), max(x)), min(y), 650, alpha=0.1, color='red')
|
| 55 |
elif boundary_type == "slant":
|
| 56 |
slope = -10.677966 # From (94, 350) and (35, 980)
|
| 57 |
intercept = 1353.7288
|
| 58 |
y_line = slope * x + intercept
|
| 59 |
-
ax.plot(x, y_line, color='blue'
|
| 60 |
ax.fill_between(x, y_line, max(y), alpha=0.1, color='green')
|
| 61 |
ax.fill_between(x, min(y), y_line, alpha=0.1, color='red')
|
| 62 |
|
|
@@ -83,7 +83,7 @@ def render():
|
|
| 83 |
with col3:
|
| 84 |
st.pyplot(plot_scatter(income, credit, colors, boundary_type="slant"))
|
| 85 |
slant_selected = st.button("Choose Model 2")
|
| 86 |
-
with
|
| 87 |
st.pyplot(plot_scatter(income, credit, colors, boundary_type="horizontal"))
|
| 88 |
horizontal_selected = st.button("Choose Model 3")
|
| 89 |
|
|
|
|
| 45 |
# Decision boundary
|
| 46 |
if boundary_type is not None:
|
| 47 |
if boundary_type == "vertical":
|
| 48 |
+
ax.axvline(65, color='blue')
|
| 49 |
ax.fill_betweenx(np.arange(min(y), max(y)), 65, max(x), alpha=0.1, color='green')
|
| 50 |
ax.fill_betweenx(np.arange(min(y), max(y)), min(x), 65, alpha=0.1, color='red')
|
| 51 |
elif boundary_type == "horizontal":
|
| 52 |
+
ax.axhline(650, color='blue')
|
| 53 |
ax.fill_between(np.arange(min(x), max(x)), 650, max(y), alpha=0.1, color='green')
|
| 54 |
ax.fill_between(np.arange(min(x), max(x)), min(y), 650, alpha=0.1, color='red')
|
| 55 |
elif boundary_type == "slant":
|
| 56 |
slope = -10.677966 # From (94, 350) and (35, 980)
|
| 57 |
intercept = 1353.7288
|
| 58 |
y_line = slope * x + intercept
|
| 59 |
+
ax.plot(x, y_line, color='blue')
|
| 60 |
ax.fill_between(x, y_line, max(y), alpha=0.1, color='green')
|
| 61 |
ax.fill_between(x, min(y), y_line, alpha=0.1, color='red')
|
| 62 |
|
|
|
|
| 83 |
with col3:
|
| 84 |
st.pyplot(plot_scatter(income, credit, colors, boundary_type="slant"))
|
| 85 |
slant_selected = st.button("Choose Model 2")
|
| 86 |
+
with col4:
|
| 87 |
st.pyplot(plot_scatter(income, credit, colors, boundary_type="horizontal"))
|
| 88 |
horizontal_selected = st.button("Choose Model 3")
|
| 89 |
|