This project implements Linear Regression from scratch using Gradient Descent to predict the number of sleep hours based on a person’s age, daily screen time, device usage before sleep, and stress level. The dataset captures the impact of digital device usage on sleep quality and mental health.
- Age
- Daily Screen Time (hours)
- Use of Devices Before Sleep (Yes/No)
- Stress Level
Target Variable:
- Sleep Hours
- Manual implementation of Linear Regression (no sklearn LinearRegression used).
- Gradient Descent algorithm used to learn model parameters.
- Feature scaling using StandardScaler for efficient training.
- Visualization of training loss (MSE) and predicted vs actual sleep hours.
- Prediction for new individuals based on input features.
- R² Score (Test Set): 0.61
- Mean Squared Error (MSE): 1.399
- Root Mean Squared Error (RMSE): 1.183 hours
- Training Loss Curve (MSE vs Epochs)
- Predicted vs Actual Sleep Hours
- Python 3
- NumPy
- Pandas
- Matplotlib
- scikit-learn (for preprocessing and train-test split only)