Mental Health Condition Prediction from Survey Responses
Mental Health Condition Prediction from Survey Responses
Project Summary
This portfolio view condenses the original notebook into a cleaner story for the web UI. The analysis focuses on a survey-style mental-health dataset, showing how the responses are structured, how the target classes are distributed, and what qualitative symptom patterns appear across the labeled conditions.
Tech Stack
- pandas
- NumPy
- seaborn
- matplotlib
- ydata-profiling (used in the original exploratory notebook)
Dataset Overview
The original notebook reports 5,000 survey records across 13 columns. Each row contains free-text or categorical responses describing sleep, concentration, anxiety, motivation, appetite, panic symptoms, and related mental-health indicators, with one labeled condition as the target.
| User_ID | How have you been feeling lately? | Have you been sleeping well? | Do you find it hard to concentrate? | Have you lost interest in activities you used to enjoy? | Do you feel tired or fatigued most of the time? | Do you feel nervous, anxious, or on edge frequently? | Have you experienced sudden panic attacks? | Do you avoid social situations or activities you used to enjoy? | Have you experienced flashbacks or nightmares about a traumatic event? | Do you feel detached from reality or your surroundings? | Mental Health Condition | Have you experienced sudden panic attacks?\tDo you avoid social situations or activities | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 4 | I've been feeling really down and empty lately | Not really. I've been having trouble falling a... | Yeah, I can't focus on anything for long | Sometimes, I find it hard to stay interested i... | Yeah, I feel exhausted all the time, even afte... | Not really, but I do feel kind of on edge when... | No, I haven't had panic attacks. My mood swing... | Not really, I enjoy being around people, but s... | No, I haven't had any flashbacks or nightmares | No, I feel pretty grounded, but sometimes I ge... | ADHD | NaN |
| 1 | 9 | I've been feeling okay, but I've been struggli... | Not really, I have trouble falling asleep and ... | NaN | Sometimes, I find it hard to stay interested i... | Yes, I often feel exhausted from the emotional... | Not really, I don't feel anxious, just restless | No, I haven't had panic attacks. My mood swing... | Not really, I enjoy being around people, but s... | es, I often have intense emotional reactions t... | Sometimes, especially when I've been using. It... | ADHD | NaN |
| 2 | 8 | I've been feeling okay, but I've been struggli... | No, I've been having trouble sleeping. I eithe... | Yes, I find it very hard to concentrate, espec... | Sometimes, I find it hard to stay interested i... | Yes, I often feel exhausted from the emotional... | Not really, I don't feel anxious, just restless | No, I haven't had panic attacks | Not really, I enjoy being around people, but s... | No, I haven't had flashbacks or nightmares | Sometimes, it's like I'm going through the mot... | Bipolar Disorder | NaN |
| 3 | 3 | I've been feeling really anxious and on edge l... | No, I've been having trouble falling asleep an... | Yes, it's really hard to focus when my emotion... | During my low periods, I have no interest in a... | Yes, I often feel exhausted from the emotional... | Not really, I don't feel anxious, just restless | Yes, sometimes I have sudden episodes of inten... | Definitely. I avoid a lot of places and people... | No, I haven't had flashbacks or nightmares | Yes, often I feel like I'm living in a differe... | Bipolar Disorder | NaN |
| 4 | 5 | I've been feeling okay, but I've been struggli... | I've been sleeping very little lately. During ... | NaN | Yeah, I used to love going out with friends an... | Yes, I feel exhausted all the time. | Definitely. I feel like I'm always on the verg... | Yes, sometimes I have sudden episodes of inten... | Yes, I tend to avoid social situations because... | No, I haven't had any flashbacks or nightmares | No, I feel pretty grounded, but sometimes I ge... | Anxiety | NaN |
<class 'pandas.core.frame.DataFrame'> RangeIndex: 5000 entries, 0 to 4999 Data columns (total 13 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 User_ID 5000 non-null int64 1 How have you been feeling lately? 5000 non-null object 2 Have you been sleeping well? 5000 non-null object 3 Do you find it hard to concentrate? 4997 non-null object 4 Have you lost interest in activities you used to enjoy? 5000 non-null object 5 Do you feel tired or fatigued most of the time? 5000 non-null object 6 Do you feel nervous, anxious, or on edge frequently? 5000 non-null object 7 Have you experienced sudden panic attacks? 5000 non-null object 8 Do you avoid social situations or activities you used to enjoy? 5000 non-null object 9 Have you experienced flashbacks or nightmares about a traumatic event? 4997 non-null object 10 Do you feel detached from reality or your surroundings? 4998 non-null object 11 Mental Health Condition 5000 non-null object 12 Have you experienced sudden panic attacks? Do you avoid social situations or activities 0 non-null float64 dtypes: float64(1), int64(1), object(11) memory usage: 507.9+ KB
User_ID 9 How have you been feeling lately? 9 Have you been sleeping well? 9 Do you find it hard to concentrate? 9 Have you lost interest in activities you used to enjoy? 9 Do you feel tired or fatigued most of the time? 9 Do you feel nervous, anxious, or on edge frequently? 9 Have you experienced sudden panic attacks? 9 Do you avoid social situations or activities you used to enjoy? 9 Have you experienced flashbacks or nightmares about a traumatic event? 8 Do you feel detached from reality or your surroundings? 9 Mental Health Condition 9 Have you experienced sudden panic attacks?\tDo you avoid social situations or activities 0 dtype: int64
Data Cleaning Notes
The raw dataset includes one malformed concatenated question column that is dropped before analysis. After that cleanup, the notebook keeps the symptom questionnaire intact and proceeds with exploratory analysis on the multiclass target.
Exploratory Analysis
A useful first pass is to inspect the class balance. A portfolio notebook benefits from showing this explicitly because it immediately tells the reader whether the downstream classifier is likely to face severe imbalance or whether macro metrics are more appropriate.
Mental Health Condition PTSD 672 Depression 645 ADHD 624 Borderline Personality Disorder 571 Anxiety 538 Eating Disorder 509 Substance Use Disorders 506 Bipolar Disorder 481 Schizophrenia 446 Name: count, dtype: int64
Qualitative Response Patterns
The original notebook continues by reviewing response themes per diagnosis. In condensed form, the main takeaways are:
PTSD: strong anxiety, hyperarousal, and sleep disruption appear frequently in the response patterns.Depression: persistent sadness, low interest, and fatigue become the dominant symptom cluster.ADHD: concentration problems and difficulty sustaining focus stand out most clearly.Borderline Personality Disorderand related conditions show more emotional volatility and interpersonal strain in the survey text.
Portfolio Takeaway
Even in a lightweight survey project, presenting the table shape, feature cardinality, and class balance makes the notebook look much more disciplined. This cleaned version keeps the original executed artifacts that are already available in the repository and reorganizes them into a tighter EDA narrative for the portfolio viewer.