File size: 3,915 Bytes
8a5c7e4 9ac6b83 8a5c7e4 9ac6b83 8a5c7e4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | # Playground Series S6E8 - Screen Addiction Prediction
Binary classification solution for Kaggle's **Playground Series - Season 6, Episode 8**,
predicting whether an individual is "addicted" to screen usage from self-reported
digital habits and lifestyle indicators.
**Metric:** ROC AUC
**Best OOF AUC:** 0.9628 (v2) Β· **Leaderboard score:** 0.96323
---
## Repo Structure
```
.
βββ data/
β βββ train.csv # Training data (691,369 rows Γ 14 cols)
β βββ test.csv # Test data (296,302 rows, no target)
β βββ sample_submission.csv # Required submission format
βββ results/
β βββ submission.csv # v1 output - single LightGBM
β βββ submission_v2.csv # v2 output - engineered features + blended ensemble
βββ train_model_v1.py # v1 training script
βββ train_model_v2.py # v2 training script
βββ README.md
```
---
## Dataset
Each row represents an individual with self-reported screen-time and lifestyle data.
Nearly every column contains missing values by design.
| Column | Type | Description |
|---|---|---|
| `id` | int | Row identifier |
| `age` | float | Age |
| `daily_screen_time_hours` | float | Avg. daily screen time |
| `social_media_hours` | float | Daily social media time |
| `gaming_hours` | float | Daily gaming time |
| `work_study_hours` | float | Daily work/study time |
| `sleep_hours` | float | Avg. nightly sleep |
| `notifications_per_day` | float | Notifications received per day |
| `app_opens_per_day` | float | App opens per day |
| `weekend_screen_time` | float | Weekend screen time |
| `gender` | category | Male / Female / Other |
| `stress_level` | category | Low / Medium / High |
| `academic_work_impact` | category | Yes / No |
| `addicted_label` | int (target) | 1 = addicted, 0 = not addicted |
Target is imbalanced: ~71% positive class, ~29% negative.
---
## Approach
### v1 - Baseline (`train_model_v1.py`)
- Single **LightGBM** classifier, 5-fold stratified CV.
- Native handling of missing values and categorical features β no imputation
or one-hot encoding.
- **Result:** OOF AUC 0.9620, leaderboard 0.96323.
### v2 - Feature Engineering + Ensemble (`train_model_v2.py`)
- Adds:
- Missingness indicator columns for every feature (missingness itself is predictive).
- Ratio/interaction features: `social_to_screen`, `gaming_to_screen`,
`sleep_deficit`, `weekend_to_screen`, `screen_per_age`,
`weekday_weekend_diff`, and others.
- Trains **LightGBM + XGBoost + CatBoost**, 3-fold stratified CV (reduced from
5 due to single-CPU compute constraints).
- Blends the three models using an OOF-AUC-maximizing weight search.
- **Result:** OOF AUC 0.9628. On this run the blend search settled on 100%
LightGBM weight, the lighter XGB/CatBoost configs (needed to fit the compute
budget) didn't outperform LightGBM individually, but the added features
still improved LightGBM itself over v1.
---
## Usage
```bash
pip install lightgbm xgboost catboost scikit-learn pandas numpy
# Baseline
python train_model_v1.py
# Feature-engineered ensemble
python train_model_v2.py
```
Each script reads `train.csv` / `test.csv` from the working directory and writes
a submission CSV (`submission.csv` or `submission_v2.csv`) in the same format as
`sample_submission.csv`:
```csv
id,addicted_label
691369,0.99
691370,0.03
...
```
Where `addicted_label` is the predicted **probability** of addiction, not a
hard 0/1 label.
---
## Notes / Next Steps
- Training was constrained to a single CPU core; with more compute, restoring
5-fold CV and deeper/longer XGBoost & CatBoost runs would likely let the
ensemble outperform LightGBM alone.
- Further gains are more likely to come from additional feature engineering
(binning, clustering, higher-order interactions) than from adding more model
types. |