Skip to content

Poorav07/sleep_prediction_based_on_mobile_usage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Predicting Sleep Hours Based on Digital Device Usage

Project Overview

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.


Features

  • Age
  • Daily Screen Time (hours)
  • Use of Devices Before Sleep (Yes/No)
  • Stress Level

Target Variable:

  • Sleep Hours

Project Highlights

  • 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.

Results

  • R² Score (Test Set): 0.61
  • Mean Squared Error (MSE): 1.399
  • Root Mean Squared Error (RMSE): 1.183 hours

Visualizations

  1. Training Loss Curve (MSE vs Epochs)
  2. Predicted vs Actual Sleep Hours

Tools & Libraries

  • Python 3
  • NumPy
  • Pandas
  • Matplotlib
  • scikit-learn (for preprocessing and train-test split only)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors