tarekmasryo commited on
Commit
b42628d
Β·
verified Β·
1 Parent(s): f9c3a59

Update README_space.md

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