Update README_space.md
Browse files- README_space.md +133 -126
README_space.md
CHANGED
|
@@ -1,126 +1,133 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
-
|
| 40 |
-
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
-
|
| 49 |
-
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
-
|
| 58 |
-
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
-
|
| 67 |
-
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
-
|
| 74 |
-
-
|
| 75 |
-
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
-
|
| 93 |
-
-
|
| 94 |
-
-
|
| 95 |
-
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
-
|
| 100 |
-
-
|
| 101 |
-
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
# 𧬠Health Intelligence Platform
|
| 4 |
+
|
| 5 |
+
Interactive Streamlit app for exploring digital wellbeing and mental health risk as a live, data-driven system β from population trends to individual what-if scenarios.
|
| 6 |
+
|
| 7 |
+
This Space runs directly in the browser. No real user records are loaded; the app generates its own population data at runtime for safe experimentation.
|
| 8 |
+
|
| 9 |
+
[](https://streamlit.io/)\
|
| 10 |
+
[](DATA_LICENSE)\
|
| 11 |
+
[](https://github.com/tarekmasryo)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
## π What this app does
|
| 17 |
+
|
| 18 |
+
The Health Intelligence Platform lets you:
|
| 19 |
+
|
| 20 |
+
- Monitor digital wellbeing and mental health risk at population level
|
| 21 |
+
- Explore behavioural patterns (screen time, sleep, stress, social usage, activity)
|
| 22 |
+
- Run interactive what-if scenarios on a single profile
|
| 23 |
+
- Generate clinical-style summaries for high-risk cohorts
|
| 24 |
+
|
| 25 |
+
Use it as a tool to think about risk, behaviour, and intervention design β **not** as a clinical decision system.
|
| 26 |
+
|
| 27 |
+
---
|
| 28 |
+
|
| 29 |
+
## π§ How to use this Space
|
| 30 |
+
|
| 31 |
+
The app is organised into several tabs:
|
| 32 |
+
|
| 33 |
+
### 1. Executive Dashboard
|
| 34 |
+
|
| 35 |
+
High-level overview of the current cohort:
|
| 36 |
+
|
| 37 |
+
- Core KPIs: active users, high-risk share, model AUC, behavioural averages
|
| 38 |
+
- Risk score distribution with a configurable threshold slider in the sidebar
|
| 39 |
+
- Time trends for screen time, stress, wellbeing, sleep, engagement, and high-risk counts
|
| 40 |
+
- Demographic views by age group, gender, location, occupation
|
| 41 |
+
|
| 42 |
+
### 2. Risk Analytics
|
| 43 |
+
|
| 44 |
+
Deeper look at the risk engine:
|
| 45 |
+
|
| 46 |
+
- Correlation heatmap for key drivers (screen time, sleep, stress, anxiety, depression, wellbeing, mood, energy, social support, loneliness, risk score)
|
| 47 |
+
- Risk distributions by segment (Low / Moderate / High)
|
| 48 |
+
- Confusion matrix and ROC curve with AUC
|
| 49 |
+
- Conceptual feature importance and focused scatter plots (screen vs sleep, stress vs wellbeing)
|
| 50 |
+
|
| 51 |
+
### 3. Behavioural Insights
|
| 52 |
+
|
| 53 |
+
Digital habits and lifestyle patterns:
|
| 54 |
+
|
| 55 |
+
- 24-hour curves for screen time, notifications, stress, and energy
|
| 56 |
+
- App usage mix (social, work/study, gaming, entertainment, other)
|
| 57 |
+
- Digital interaction metrics across risk segments (unlocks, notifications)
|
| 58 |
+
- Physical vs digital balance and quick health indicators (sleep deficit, high stress, inactivity)
|
| 59 |
+
|
| 60 |
+
### 4. Scenario Simulator
|
| 61 |
+
|
| 62 |
+
Interactive what-if engine for a single profile:
|
| 63 |
+
|
| 64 |
+
- Adjust digital, health, physical, and social variables using sliders
|
| 65 |
+
- See risk score, risk segment, intervention flag, and population percentile update in real time
|
| 66 |
+
- Compare the scenario to population averages and view a radar profile
|
| 67 |
+
- Apply pre-defined intervention bundles (digital reset, sleep protocol, holistic plan) with generated recommendations
|
| 68 |
+
|
| 69 |
+
### 5. Clinical Reports
|
| 70 |
+
|
| 71 |
+
Structured view of the highest-risk users:
|
| 72 |
+
|
| 73 |
+
- Ranked list of top-risk users with demographics and key indicators
|
| 74 |
+
- One-click CSV export of the high-risk cohort
|
| 75 |
+
- Summary tables for risk segments, mental health metrics, and behavioural metrics
|
| 76 |
+
|
| 77 |
+
Use the sidebar to:
|
| 78 |
+
|
| 79 |
+
- Set the risk threshold
|
| 80 |
+
- Filter by risk segment, age group, gender, occupation
|
| 81 |
+
- Filter by screen time and stress ranges
|
| 82 |
+
- Toggle AI insights and analytics, and export data (CSV / JSON)
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## π§ Data & Risk Engine
|
| 87 |
+
|
| 88 |
+
The app builds a rich, internally generated dataset that includes:
|
| 89 |
+
|
| 90 |
+
- **Demographics:** `age`, `age_group`, `gender`, `location`, `occupation`
|
| 91 |
+
- **Digital behaviour:** `screen_hours`, `phone_unlocks`, `notifications`, `social_minutes`, `gaming_minutes`, `work_minutes`
|
| 92 |
+
- **Lifestyle & health:** `exercise_minutes`, `outdoor_time`, `steps_daily`, `bmi`, `heart_rate`
|
| 93 |
+
- **Mental health:** `stress`, `anxiety`, `depression`, `focus`, `wellbeing`, `mood`, `energy`
|
| 94 |
+
- **Social context:** `social_support`, `loneliness`
|
| 95 |
+
- **Engagement:** `last_active`, `engagement_score`
|
| 96 |
+
|
| 97 |
+
Risk is computed using a logistic risk function over weighted combinations of:
|
| 98 |
+
|
| 99 |
+
- Digital exposure and intensity
|
| 100 |
+
- Stress, anxiety, depression, wellbeing, mood, energy
|
| 101 |
+
- Sleep, activity, outdoor time
|
| 102 |
+
- Social support and loneliness
|
| 103 |
+
|
| 104 |
+
From this, the app derives:
|
| 105 |
+
|
| 106 |
+
- `risk_score` in (0, 1)
|
| 107 |
+
- `high_risk` label
|
| 108 |
+
- `risk_segment β {Low, Moderate, High}`
|
| 109 |
+
|
| 110 |
+
The emphasis is on interpretability and controllable experimentation in digital wellbeing analytics. It does not replace professional clinical judgement.
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
+
|
| 114 |
+
## π§© Tech Stack
|
| 115 |
+
|
| 116 |
+
- **Python**
|
| 117 |
+
- **Streamlit** (app framework)
|
| 118 |
+
- **NumPy** (numerical computations)
|
| 119 |
+
- **pandas** (data manipulation)
|
| 120 |
+
- **Plotly** (interactive charts)
|
| 121 |
+
- **scikit-learn metrics** (AUC, PR, Brier score, ROC, confusion matrix)
|
| 122 |
+
|
| 123 |
+
---
|
| 124 |
+
|
| 125 |
+
## π₯ Run locally
|
| 126 |
+
|
| 127 |
+
If you want to run the same app outside Hugging Face Spaces:
|
| 128 |
+
|
| 129 |
+
```bash
|
| 130 |
+
git clone https://github.com/tarekmasryo/health-intelligence-platform.git
|
| 131 |
+
cd health-intelligence-platform
|
| 132 |
+
pip install -r requirements.txt
|
| 133 |
+
streamlit run app.py
|