Sleep Disorder Prediction Using Machine Learning Project

The purpose of this project is to analyze factors that affect sleep health and predict which sleep disorder a person may have based on various factors such as Sleep Quality, Stress Level, BMI Index, Blood Pressure, etc. The dataset used for this project was sourced from Kaggle. The project involved data preprocessing to fill null values, exploratory data analysis (EDA), and the implementation of machine learning models to make predictions.

Key Observations

  1. Individuals aged over 43 years are more likely to experience sleep disorders.
  2. On average, females tend to have better sleep quality compared to males.
  3. Engineers generally have better sleep quality, while Sales Representatives have poorer sleep quality.
  4. Higher stress levels are associated with an increased likelihood of sleep disorders.
  5. Individuals with sleep disorders have lower sleep quality ratings compared to those without disorders.
  6. People in the Obese and Overweight BMI categories tend to experience more sleep disorders.
  7. Individuals who sleep more than 7 hours have a significantly lower chance of having a sleep disorder.

Models Used

Three machine learning models were used:

  1. Logistic Classification
  2. K-Nearest Neighbors (KNN) Classifier
  3. Random Forest Classifier

The same training and testing sets were used for all models.

Model Performance

  • Random Forest Classifier: Best performing model with an accuracy of 89%.
    • Accuracy: 89%
    • Recall: 89%
    • Precision: 90%
    • F1-Score: 89%
  • KNN Classifier: Performed well but not as good as Random Forest.
  • Logistic Classification: Achieved 86% accuracy, which was the lowest among the three models.

Important Features

Based on the Random Forest Classifier, the top three important features for detecting sleep disorders are:

  1. Blood Pressure
  2. BMI Category
  3. Age

Conclusion

 

The Random Forest Classifier was identified as the best model for predicting sleep disorders in the given dataset, achieving an accuracy of 89%. The top three contributing features to the prediction are Blood Pressure, BMI Category, and Age.

Dataset

The dataset for this project was obtained from Kaggle.

Technology Used in the project :-

  1. We have developed this project using the below technology
  2. HTML : Page layout has been designed in HTML
  3. CSS : CSS has been used for all the desigining part
  4. JavaScript : All the validation task and animations has been developed by JavaScript
  5. Python : All the business logic has been implemented in Python
  6. Flask: Project has been developed over the Flask Framework

Supported Operating System :-

  1. We can configure this project on following operating system.
  2. Windows : This project can easily be configured on windows operating system. For running this project on Windows system, you will have to install
  3. Python 3.8, PIP, Django.
  4. Linux : We can run this project also on all versions of Linux operating systemMac : We can also easily configured this project on Mac operating system.

Installation Step : -

  1. python 3.8.0
  2. command 1 - python -m pip install --user -r requirements.txt
  3. command 2 - python app.py

Buy Now Source Code ₹1001

 

Posted in Machine Learning Projects With Source Code.