Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
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 |
-
|
|
|
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"
|