Update my_pages/rashomon_effect.py
Browse files
my_pages/rashomon_effect.py
CHANGED
|
@@ -5,6 +5,12 @@ from utils import add_navigation, add_instruction_text
|
|
| 5 |
|
| 6 |
plt.style.use('dark_background')
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
def plot_scatter(x, y, colors, title="", boundary_type=None, highlight_point=None):
|
| 9 |
fig, ax = plt.subplots(figsize=(2, 2))
|
| 10 |
ax.scatter(x, y, c=colors, alpha=0.6)
|
|
@@ -46,7 +52,7 @@ def plot_scatter(x, y, colors, title="", boundary_type=None, highlight_point=Non
|
|
| 46 |
return fig
|
| 47 |
|
| 48 |
def render():
|
| 49 |
-
add_navigation("txt_rashomon_effect", "
|
| 50 |
|
| 51 |
add_instruction_text(
|
| 52 |
"""
|
|
@@ -65,12 +71,6 @@ def render():
|
|
| 65 |
unsafe_allow_html=True,
|
| 66 |
)
|
| 67 |
|
| 68 |
-
#### Setup data to plot
|
| 69 |
-
income = np.array([80, 85, 97, 91, 78, 102, 84, 88, 81, 40, 45, 51, 34, 47, 38, 39, 97, 91, 38, 32])
|
| 70 |
-
credit = np.array([970, 880, 1020, 910, 805, 800, 804, 708, 810, 370, 470, 309, 450, 304, 380, 501, 370, 301, 1080, 902])
|
| 71 |
-
labels = np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1])
|
| 72 |
-
colors = ['green' if label == 1 else 'red' for label in labels]
|
| 73 |
-
|
| 74 |
#### Plot three graphs to represent three models
|
| 75 |
graph_selected, highlight_point = None, None
|
| 76 |
if "graph_selected" in st.session_state:
|
|
|
|
| 5 |
|
| 6 |
plt.style.use('dark_background')
|
| 7 |
|
| 8 |
+
#### Setup data to plot
|
| 9 |
+
income = np.array([80, 85, 97, 91, 78, 102, 84, 88, 81, 40, 45, 51, 34, 47, 38, 39, 97, 91, 38, 32])
|
| 10 |
+
credit = np.array([970, 880, 1020, 910, 805, 800, 804, 708, 810, 370, 470, 309, 450, 304, 380, 501, 370, 301, 1080, 902])
|
| 11 |
+
labels = np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1])
|
| 12 |
+
colors = ['green' if label == 1 else 'red' for label in labels]
|
| 13 |
+
|
| 14 |
def plot_scatter(x, y, colors, title="", boundary_type=None, highlight_point=None):
|
| 15 |
fig, ax = plt.subplots(figsize=(2, 2))
|
| 16 |
ax.scatter(x, y, c=colors, alpha=0.6)
|
|
|
|
| 52 |
return fig
|
| 53 |
|
| 54 |
def render():
|
| 55 |
+
add_navigation("txt_rashomon_effect", "txt_rashomon_developer")
|
| 56 |
|
| 57 |
add_instruction_text(
|
| 58 |
"""
|
|
|
|
| 71 |
unsafe_allow_html=True,
|
| 72 |
)
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
#### Plot three graphs to represent three models
|
| 75 |
graph_selected, highlight_point = None, None
|
| 76 |
if "graph_selected" in st.session_state:
|