chayanee commited on
Commit
f16a8ff
·
1 Parent(s): 528a9e8

Upload 2 files

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -19,6 +19,7 @@ def main():
19
  Sleep_Duration = st.slider("Sleep Duration", min_value=0, max_value=24)
20
  Quality_of_Sleep = st.slider("Quality of Sleep", min_value=1, max_value=10)
21
  Physical_Activity_Level = st.slider("Quality of Sleep", min_value=0, max_value=1440)
 
22
  BMI_Category = st.selectbox("ฺBMI Category", unique_ฺBMI)
23
  Blood_Pressure = st.selectbox("Blood Pressure", unique_Blood)
24
  Heart_Rate = st.slider("Heart Rate", min_value=60, max_value=100)
@@ -26,15 +27,16 @@ def main():
26
 
27
  clicked = st.form_submit_button("Predict Sleep Health")
28
  if clicked:
29
- result=model.predict(pd.DataFrame({"age": [age],
30
- "Gender": [Gender],
31
  "Occupation": [occupation],
32
- "Sleep Duration (hours)": [Sleep_Duration],
33
- "Quality of Sleep (scale: 1-10)": [Quality_of_Sleep],
34
- "Physical Activity Level (minutes/day)": [Physical_Activity_Level],
 
35
  "BMI Category": [BMI_Category],
36
- "Blood Pressure (systolic/diastolic)": [Blood_Pressure],
37
- "Heart Rate (bpm)": [Heart_Rate],
38
  "Daily Steps": [Daily_Steps]
39
  }))
40
  if result[0] == 1:
 
19
  Sleep_Duration = st.slider("Sleep Duration", min_value=0, max_value=24)
20
  Quality_of_Sleep = st.slider("Quality of Sleep", min_value=1, max_value=10)
21
  Physical_Activity_Level = st.slider("Quality of Sleep", min_value=0, max_value=1440)
22
+ Stress_Level= st.slider("Quality of Sleep", min_value=1, max_value=10)
23
  BMI_Category = st.selectbox("ฺBMI Category", unique_ฺBMI)
24
  Blood_Pressure = st.selectbox("Blood Pressure", unique_Blood)
25
  Heart_Rate = st.slider("Heart Rate", min_value=60, max_value=100)
 
27
 
28
  clicked = st.form_submit_button("Predict Sleep Health")
29
  if clicked:
30
+ result=model.predict(pd.DataFrame({"Gender": [Gender],
31
+ "Age": [age],
32
  "Occupation": [occupation],
33
+ "Sleep Duration": [Sleep_Duration],
34
+ "Quality of Sleep": [Quality_of_Sleep],
35
+ "Physical Activity Level": [Physical_Activity_Level],
36
+ "Stress Level":[Stress_Level],
37
  "BMI Category": [BMI_Category],
38
+ "Blood Pressure ": [Blood_Pressure],
39
+ "Heart Rate": [Heart_Rate],
40
  "Daily Steps": [Daily_Steps]
41
  }))
42
  if result[0] == 1: