prakharg24 commited on
Commit
ee2c687
·
verified ·
1 Parent(s): 87dd542

Update my_pages/information_loss.py

Browse files
Files changed (1) hide show
  1. my_pages/information_loss.py +21 -17
my_pages/information_loss.py CHANGED
@@ -3,15 +3,15 @@ import streamlit as st
3
  from utils import add_navigation, add_instruction_text
4
 
5
  ALL_FEATURES = [
6
- ("Liquid Assets", "Liquid Assets", "Added"),
7
- ("Illiquid Assets", "Property appraisals, Insurance valuations, etc.",
8
  "Sorry, it is not possible to get the precise value of illiquid assets. We will use some approximate alternatives instead."),
9
- ("Current Debts", "Current Debts", "Added"),
10
- ("Income Stability", "Past Income Stability",
11
  "Sorry, it is not possible to know precisely how stable someone's income will be in future. Until someone invents a time machine (we're hopeful!), we will instead use past income stability."),
12
- ("Health Trajectory", "Current Health Indicators",
13
  "Sorry, it is not possible to know precisely how will someone's health change in the future. Until someone invents a time machine (we're hopeful!), we will instead use current health indicators."),
14
- ("Financial Discipline", "Credit Score",
15
  "Sorry, financial discipline is not a directly measurable quality. We will use credit score as an approximation instead.")
16
  ]
17
 
@@ -63,7 +63,7 @@ def render():
63
  _ = st.button(feature[0], type="tertiary")
64
  else:
65
  if st.button(feature[0]):
66
- st.session_state.selected_features.append(feature)
67
  st.session_state.show_message = feature[2]
68
  st.rerun()
69
 
@@ -74,13 +74,17 @@ def render():
74
  )
75
  del st.session_state.show_message
76
 
77
- # st.markdown("---")
78
-
79
- # # Bottom half: dataset table
80
- # st.markdown("### Current Dataset")
81
- # if st.session_state.selected_features:
82
- # cols = st.session_state.selected_features + ["Target Label"]
83
- # df = pd.DataFrame(columns=cols)
84
- # st.dataframe(df, use_container_width=True)
85
- # else:
86
- # st.info("No features added yet. Click a feature above to add it to the dataset.")
 
 
 
 
 
3
  from utils import add_navigation, add_instruction_text
4
 
5
  ALL_FEATURES = [
6
+ ("Liquid Assets", ["Liquid Assets"], "Added"),
7
+ ("Illiquid Assets", ["Property appraisals, Insurance valuations, etc."],
8
  "Sorry, it is not possible to get the precise value of illiquid assets. We will use some approximate alternatives instead."),
9
+ ("Current Debts", ["Current Debts"], "Added"),
10
+ ("Income Stability", ["Past Income Stability"],
11
  "Sorry, it is not possible to know precisely how stable someone's income will be in future. Until someone invents a time machine (we're hopeful!), we will instead use past income stability."),
12
+ ("Health Trajectory", ["Current Health Indicators"],
13
  "Sorry, it is not possible to know precisely how will someone's health change in the future. Until someone invents a time machine (we're hopeful!), we will instead use current health indicators."),
14
+ ("Financial Discipline", ["Credit Score"],
15
  "Sorry, financial discipline is not a directly measurable quality. We will use credit score as an approximation instead.")
16
  ]
17
 
 
63
  _ = st.button(feature[0], type="tertiary")
64
  else:
65
  if st.button(feature[0]):
66
+ st.session_state.selected_features.extend(feature[1])
67
  st.session_state.show_message = feature[2]
68
  st.rerun()
69
 
 
74
  )
75
  del st.session_state.show_message
76
 
77
+ #### Selected features shown at the bottom
78
+ st.markdown("---")
79
+
80
+ st.markdown("### Set of Selected Features:")
81
+ if st.session_state.selected_features:
82
+ col1, col2 = st.columns(2)
83
+
84
+ for i, item in enumerate(st.session_state.selected_features):
85
+ if i % 2 == 0:
86
+ col1.markdown(f"- {item}")
87
+ else:
88
+ col2.markdown(f"- {item}")
89
+ else:
90
+ st.info("No features added yet. Click a feature above to add it to the dataset.")