zoya23 commited on
Commit
0ae1060
·
verified ·
1 Parent(s): b96d903

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,10 +11,10 @@ st.write("Predict sleep state (`onset` or `wakeup`) using step count and hour.")
11
 
12
  # Input Features
13
  step = st.number_input("Step count:", min_value=0, max_value=10000, value=0)
14
- hour = st.slider("Hour of day (0–23):", min_value=0, max_value=23, value=0)
15
 
16
  # Predict Button
17
  if st.button("Predict Sleep State"):
18
  input_data = np.array([[step, hour]])
19
  prediction = model.predict(input_data)[0]
20
- st.success(f"Predicted Sleep State: **{prediction}**")
 
11
 
12
  # Input Features
13
  step = st.number_input("Step count:", min_value=0, max_value=10000, value=0)
14
+ hour = st.number_input("Hour of day (0–23):", min_value=0, max_value=23, value=0)
15
 
16
  # Predict Button
17
  if st.button("Predict Sleep State"):
18
  input_data = np.array([[step, hour]])
19
  prediction = model.predict(input_data)[0]
20
+ return "Sleep Onset" if prediction == 1 else "Wakeup"