Update my_pages/rashomon_developer.py
Browse files- my_pages/rashomon_developer.py +13 -12
my_pages/rashomon_developer.py
CHANGED
|
@@ -19,7 +19,7 @@ def render():
|
|
| 19 |
|
| 20 |
#### Choosing regularization
|
| 21 |
st.markdown("""
|
| 22 |
-
**Regularization:** Regularization is a technique commonly used to stop models from learning the noise or small quirks in the data
|
| 23 |
|
| 24 |
Choose a regularization method:
|
| 25 |
- L1 Regularization: Force your AI model to use less number of features, thus avoiding irrelevant features.
|
|
@@ -51,7 +51,8 @@ def render():
|
|
| 51 |
#### Choosing random seed
|
| 52 |
if regularization_method=="l1":
|
| 53 |
st.markdown("""
|
| 54 |
-
**Randomness:** Sometimes there is randomness in the learning process.
|
|
|
|
| 55 |
"""
|
| 56 |
)
|
| 57 |
random_seed = None
|
|
@@ -59,20 +60,20 @@ def render():
|
|
| 59 |
random_seed = st.session_state.random_seed
|
| 60 |
col1, col2 = st.columns([1, 1])
|
| 61 |
with col1:
|
| 62 |
-
if random_seed=="
|
| 63 |
-
button_click_1 = st.button("
|
| 64 |
else:
|
| 65 |
-
button_click_1 = st.button("
|
| 66 |
if button_click_1:
|
| 67 |
-
st.session_state.random_seed = "
|
| 68 |
st.rerun()
|
| 69 |
with col2:
|
| 70 |
-
if random_seed=="
|
| 71 |
-
button_click_2 = st.button("
|
| 72 |
else:
|
| 73 |
-
button_click_2 = st.button("
|
| 74 |
if button_click_2:
|
| 75 |
-
st.session_state.random_seed = "
|
| 76 |
st.rerun()
|
| 77 |
|
| 78 |
#### Plot the final figure
|
|
@@ -80,9 +81,9 @@ def render():
|
|
| 80 |
if regularization_method=="l2":
|
| 81 |
plot_chosen = "slant"
|
| 82 |
if regularization_method=="l1":
|
| 83 |
-
if random_seed=="
|
| 84 |
plot_chosen = "vertical"
|
| 85 |
-
elif random_seed=="
|
| 86 |
plot_chosen = "horizontal"
|
| 87 |
|
| 88 |
if plot_chosen is not None:
|
|
|
|
| 19 |
|
| 20 |
#### Choosing regularization
|
| 21 |
st.markdown("""
|
| 22 |
+
**Regularization:** Regularization is a technique commonly used to stop AL models from learning the noise or small quirks in the data that might not generalize.
|
| 23 |
|
| 24 |
Choose a regularization method:
|
| 25 |
- L1 Regularization: Force your AI model to use less number of features, thus avoiding irrelevant features.
|
|
|
|
| 51 |
#### Choosing random seed
|
| 52 |
if regularization_method=="l1":
|
| 53 |
st.markdown("""
|
| 54 |
+
**Randomness:** Sometimes there is randomness in the learning process. Let's flip a coin
|
| 55 |
+
(You can just choose Heads or Tails, and we will assume we fliiped a coin, our little secret :P).
|
| 56 |
"""
|
| 57 |
)
|
| 58 |
random_seed = None
|
|
|
|
| 60 |
random_seed = st.session_state.random_seed
|
| 61 |
col1, col2 = st.columns([1, 1])
|
| 62 |
with col1:
|
| 63 |
+
if random_seed=="Heads":
|
| 64 |
+
button_click_1 = st.button("Heads", type="primary")
|
| 65 |
else:
|
| 66 |
+
button_click_1 = st.button("Heads")
|
| 67 |
if button_click_1:
|
| 68 |
+
st.session_state.random_seed = "Heads"
|
| 69 |
st.rerun()
|
| 70 |
with col2:
|
| 71 |
+
if random_seed=="Tails":
|
| 72 |
+
button_click_2 = st.button("Tails", type="primary")
|
| 73 |
else:
|
| 74 |
+
button_click_2 = st.button("Tails")
|
| 75 |
if button_click_2:
|
| 76 |
+
st.session_state.random_seed = "Tails"
|
| 77 |
st.rerun()
|
| 78 |
|
| 79 |
#### Plot the final figure
|
|
|
|
| 81 |
if regularization_method=="l2":
|
| 82 |
plot_chosen = "slant"
|
| 83 |
if regularization_method=="l1":
|
| 84 |
+
if random_seed=="Heads":
|
| 85 |
plot_chosen = "vertical"
|
| 86 |
+
elif random_seed=="Tails":
|
| 87 |
plot_chosen = "horizontal"
|
| 88 |
|
| 89 |
if plot_chosen is not None:
|