Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,4 +68,19 @@ st.markdown(
|
|
| 68 |
# Sidebar inputs
|
| 69 |
st.sidebar.header("Input Parameters")
|
| 70 |
location = st.sidebar.selectbox("Select Location", data["Location"].unique())
|
| 71 |
-
temperature = st.sidebar.slider("Temperature (°C)", 20, 40,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
# Sidebar inputs
|
| 69 |
st.sidebar.header("Input Parameters")
|
| 70 |
location = st.sidebar.selectbox("Select Location", data["Location"].unique())
|
| 71 |
+
temperature = st.sidebar.slider("Temperature (°C)", 20, 40, 25)
|
| 72 |
+
humidity = st.sidebar.slider("Humidity (%)", 30, 90, 50)
|
| 73 |
+
|
| 74 |
+
# Prediction
|
| 75 |
+
st.subheader("Predicted AQI")
|
| 76 |
+
prediction = predict_aqi(model, temperature, humidity)
|
| 77 |
+
st.write(f"The predicted AQI for {location} is: {prediction}")
|
| 78 |
+
|
| 79 |
+
# Historical trends visualization
|
| 80 |
+
st.subheader("Historical Data Trends")
|
| 81 |
+
trends_image = plot_trends(data, location)
|
| 82 |
+
st.image(trends_image)
|
| 83 |
+
|
| 84 |
+
# Model performance
|
| 85 |
+
st.sidebar.subheader("Model Performance")
|
| 86 |
+
st.sidebar.write(f"Mean Squared Error: {mse:.2f}")
|