gokulv7/depressionpredictor
A Vetiver-powered XGBoost model deployed via Docker to detect student depression likelihood from survey data.
π§ DepScan: Student Depression Prediction Model
Depression is one of the most pressing - yet often hidden - challenges faced by students today. DepScan is a machine learning model designed to detect potential depression in students based on academic, personal, and lifestyle indicators. Our goal is not to replace clinical intervention, but to support early, proactive, and empathetic action from educational institutions and healthcare providers.
π¦ Dataset Description
- Source: Kaggle - Student Depression Dataset
- Owner: Adil Shamim
- Format: CSV (each row = one student)
- Sample Size: 27,901 student records
- Files Used:
student_depression_dataset.csv - Target Variable:
Depression(Binary: 0 = No Depression, 1 = Depression) - Key Features:
- Demographics: Age, Gender, City
- Academics: CGPA, Academic Pressure, Degree
- Lifestyle: Sleep Duration, Dietary Habits, Work/Study Hours
- Mental Health Indicators: Suicidal thoughts, Financial stress, Family history
Note: The dataset represents Indian student populations, which makes cultural context important. Future versions should validate across global populations for generalizability.
π Key Features of the Model
- Academic Pressure: Level of stress from academic workload
- Financial Stress: Pressure due to financial difficulties
- Study Satisfaction: Studentβs contentment with academic environment
- Sleep Duration: Average hours of sleep per day
- Suicidal Thoughts: Self-reported suicidal ideation (Yes/No)
- CGPA: Cumulative grade point average
- Work Pressure: Stress from part-time jobs or academic duties
- Family History of Mental Illness: Genetic predisposition (Yes/No)
These features showed strong predictive power for identifying depressive symptoms in students during model training.
π§ͺ Model Performance
Both models were trained on 80% of the data and validated on the remaining 20%.
π οΈ Model Revisions
π Week of June 30 β July 6, 2025
- Switched from Random Forest to XGBoost
- Added one-hot encoding for categorical variables
- Introduced early stopping to avoid overfitting
- Tuned hyperparameters:
max_depth = 6,eta = 0.03 - Improved test accuracy from 83.6% β 85.0%
Note: This section is updated weekly to track changes in model design and performance.
π» How to Use
- Clone this repository
- Run the script (
studep_xgb_model.R) in RStudio - Load the dataset or use your own
- View predictions and performance metrics
π» User Experience
Visit this repository to:
- π Explore the latest XGBoost model and dataset
- π View top predictive features (e.g., academic pressure, financial stress)
- π§ͺ Test the model using mock or institutional data
- βοΈ Access API-ready endpoints for integration (coming soon)
- π Read about ethical considerations, dataset privacy, and limitations
The project also includes:
- Visual walkthroughs (feature importance plots, confusion matrix, and performance logs)
- A quick-start
.Rscript to run the model on your own data - Clear documentation and examples for R users
π― Use Cases
- Universities: Embed in wellness check-ins or orientation programs to identify at-risk students early.
- Counselors: Use predictions as supportive insight during counseling sessions.
- Researchers: Analyze depression trends and associated lifestyle or academic factors.
- NGOs / Policy Makers: Inform mental health program design for youth and student communities.
β οΈ Ethical Note
This model is not a medical diagnostic tool. It supports early identification, not clinical diagnosis. Please ensure student privacy, consent, and data security are strictly upheld when deploying or analyzing results.
π Files Included
π Acknowledgements
Special thanks to Adil Shamim for compiling and sharing the dataset via Kaggle: π Student Depression Dataset on Kaggle
π« Contact
For feedback, collaboration, or deployment support, reach out via: π LinkedIn
Letβs make mental health support more proactive, data-driven, and compassionate.
