Challenge
Environmental data is messy. I wanted to see if I could extract meaningful predictions from complex rainfall and usage patterns.
Solution
Combined robust data preprocessing with a Random Forest model and a visual 'What-If' simulator.
Workspace
root
app.py
data
Groundwater.csv
app.py
1import streamlit as st
2import plotly.express as px
3
4st.title("💧 My Groundwater Analytics")
5
6# Scenario Analysis Tool
7st.header("🔮 Simulation Tool")
8col1, col2 = st.columns(2)
9
10with col1:
11 rain = st.slider("Monsoon Rainfall", 0.0, 50.0, 15.0)
12 usage = st.slider("Irrigation Usage", 0.0, 50.0, 10.0)
13
14# Real-time Feature Engineering
15usage_intensity = usage / (avail + 1e-5)
16recharge_eff = rain / (total_rain + 1e-5)
17
18prediction = model.predict([[rain, usage, usage_intensity, recharge_eff]])
19st.metric("Predicted Stress Level", prediction)
Console
Initializing Groundwater Analytics Environment...
Connecting to Scikit-Learn backends...
Ready.
Building the Interface
I built this dashboard to visualize how changes in rainfall and usage affect water stress in real-time.
Key Insight
I learned that seeing the data move with a slider makes it much easier to understand the 'tipping points' of water stress.
Project Specs
Dataset
Indian States Groundwater
Architecture
Random Forest
Framework
Streamlit + Plotly
Concept
Scenario Simulation
Implementation Details
- What-If Analysis
- Dynamic Plotly Charts
- Sidebar Navigation