Downloads · 30 days
0
pelegelraz/coffee-sleep-predictor
coffee-sleep-predictor is a machine learning model from pelegelraz. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This project implemented a complete ML pipeline on the Global Coffee Health Dataset (~10,000 records). The final models are selected based on optimal accuracy, simplicity, and ethical considerations for health risk id…
Downloads · 30 days
0
Access
Public
Updated Dec 5, 2025
Repo size
787 KB
Likes
0
Public
Click a slice to open those files.
.ipynb2.2 MB · 74%
From the Hugging Face model README
This project implemented a complete ML pipeline on the Global Coffee Health Dataset (~10,000 records). The final models are selected based on optimal accuracy, simplicity, and ethical considerations for health risk identification.
| Model Task | Final Winner | Key Metric (R2 / F1) | Rationale |
|---|---|---|---|
| Regression (Sleep Hours) | Linear Regression (Baseline) | 0.8367 | Optimal accuracy achieved with maximum simplicity; FE did not yield improvement. |
| Classification (Health Risk) | Logistic Regression | 0.849 | Fastest, most interpretable, and achieved {Recall} = {1.00} on the critical risk class. |
The initial EDA revealed a weak negative correlation ( -0.19) between the primary numerical predictor ({Caffeine\mg}) and the target ({Sleep\Hours}), proving that prediction relied on complex, hidden factors.

The Feature Importance analysis revealed that Sleep\Quality and Stress\Level were the dominant predictors in the baseline Linear Regression model.

Complex FE was performed to challenge the linear baseline and capture non-linear interactions, including the creation of the {Physical\Health\Cluster} feature.

The comparison showed that the complex FE features did not improve the accuracy of the Linear Regression baseline.
| Model | {R}^2 Score | {RMSE} (Hours) | Insight |
|---|---|---|---|
| LR Baseline (Winner) | {0.8367} | {0.4874} | Accuracy driven by simple categorical encoding. |
| Random Forest | 0.8346 | 0.4904 | Failed to find additional non-linear value. |
The Linear Regression Baseline was declared the winner; the sophisticated modeling was unable to justify its complexity by improving on the initial linear result.
