Downloads · 30 days
0
abdullah1904/Mental-Health-Score-Predictor
Mental-Health-Score-Predictor is a tabular regression model from abdullah1904. Use it for the tabular regression task on the model card, and read the license before you ship it in a product. It is set up for scikit-learn. The card lists the license as mit.
A regression model that predicts a person's Mental Health Score (0–10) from their social media usage habits, sleep, study, physical activity, and stress level.
Downloads · 30 days
0
Access
Public
Updated Sep 2, 2026
Repo size
25.7 MB
Likes
0
Public
Click a slice to open those files.
.pkl25.7 MB · 96%
From the Hugging Face model README
A regression model that predicts a person's Mental Health Score (0–10) from their social media usage habits, sleep, study, physical activity, and stress level.
The goal is simple: understand how daily digital habits and lifestyle factors relate to mental well-being, and offer a working baseline model others can build on.
Mental_Health_Score (continuous, 0–10)Pipeline.pkl (via joblib)Not intended for: clinical, diagnostic, or any real-world mental health decision-making. This model is trained on a small, self-reported survey-style dataset and does not represent a validated psychological assessment.
Age, Gender, Country, Academic_LevelMost_Used_Platform, Purpose_Of_UseAvg_Daily_Usage_Hours, Daily_UnlocksStudy_Hours, Physical_Activity_Hours, Sleep_Hours_Per_NightStress_Level (ordinal: Low → Very High)Mental_Health_ScorePhysical_Activity_Hours clipped at 0 (no negative values).Country grouped into top-10 countries + "Other" to reduce cardinality.Study_Hours (right-skewed) log-transformed, then scaled.Stress_Level ordinal-encoded (Low → Very High).Four models were compared, with Random Forest tuned via Grid Search and Randomized Search:
| Model | R² (Test) | R² (Train) | MAE | MSE | RMSE |
|---|---|---|---|---|---|
| Linear Regression | 0.740 | 0.724 | 0.536 | 0.457 | 0.676 |
| Random Forest (default) | 0.878 | 0.981 | 0.347 | 0.215 | 0.464 |
| Random Forest (Grid Search) | 0.872 | 0.969 | 0.358 | 0.225 | 0.474 |
| Random Forest (Random Search) | 0.865 | 0.955 | 0.369 | 0.237 | 0.487 |
The default Random Forest performed best on the test set and is the model
saved (Mental_Health_Model.pkl). Tuned versions traded a bit of test
performance for lower variance — worth exploring further if generalization to
new data is a priority.
import joblib
import pandas as pd
model = joblib.load("Mental_Health_Model.pkl")
sample = pd.DataFrame([{
"Age": 21,
"Gender": "Male",
"Academic_Level": "Undergraduate",
"Most_Used_Platform": "Instagram",
"Purpose_Of_Use": "Entertainment",
"Avg_Daily_Usage_Hours": 4.5,
"Daily_Unlocks": 140,
"Study_Hours": 4.0,
"Physical_Activity_Hours": 2.0,
"Sleep_Hours_Per_Night": 6.5,
"Stress_Level": "Medium",
"Grouped_Country": "Other"
}])
prediction = model.predict(sample)
print(f"Predicted Mental Health Score: {prediction[0]:.2f}")
Note: the model expects the same preprocessing pipeline it was trained with (it's bundled inside the saved
Pipeline), so raw feature columns can be passed directly as shown above.
notebook.ipynb — full workflow: EDA, cleaning, feature engineering,
training, tuning, and evaluation.data.csv — training dataset.Mental_Health_Model.pkl — trained Random Forest pipeline.Released under the MIT License. Use freely for learning and experimentation.