adeputr4/mental-health-gaming-predictor
0
Mental Health Gaming Predictor
Predicts depression_score (0–10) based on gaming behavior using a Model Chaining architecture.
Tugas 4: Modeling Experiments — Kelompok 3
Architecture
daily_gaming_hours + competitive_rank
↓
Imputer (predict addiction_level)
↓
[addiction_level, daily_gaming_hours, competitive_rank]
↓
Scaler (StandardScaler)
↓
Predictor (Linear Regression / Random Forest)
↓
depression_score (0–10)Models
Performance
Linear Regression is the recommended model — nearly identical R² with 70× faster inference.
Risk Classification
Usage
import joblib
import numpy as np
import pandas as pd
# Load models
imputer = joblib.load("model_prediksi_adiksi.pkl")
scaler = joblib.load("scaler_mental_health.pkl")
predictor = joblib.load("model_regresi_mental_health.pkl")
# Input
daily_gaming_hours = 6.0
competitive_rank = 80 # percentile 1-100
# Step 1: Predict addiction level (if unknown)
addiction_level = imputer.predict(pd.DataFrame({
"daily_gaming_hours": [daily_gaming_hours],
"competitive_rank": [competitive_rank]
}))[0]
# Step 2: Scale features
features = pd.DataFrame({
"addiction_level": [addiction_level],
"daily_gaming_hours": [daily_gaming_hours],
"competitive_rank": [competitive_rank]
})
scaled = scaler.transform(features)
# Step 3: Predict depression score
score = predictor.predict(scaled)[0]
print(f"Depression Score: {score:.2f}")Dataset
Synthetic gaming behavior and mental health dataset from Kaggle (968,287 rows, 39 columns). Available at: adeputr4/mental-health-gaming-dataset
