This project focuses on predicting sleep disorders using machine learning techniques. Sleep disorders such as insomnia and sleep apnea can significantly impact human health and daily productivity. By analyzing lifestyle, health, and sleep-related data, this project builds predictive models that identify patterns associated with sleep disorders.
The objective of this project is to apply data science methodologies including data preprocessing, exploratory data analysis, machine learning modeling, and visualization to better understand sleep-related health conditions.
The dataset contains various attributes related to a person's lifestyle, health condition, and sleep habits.
- Age
- Gender
- Occupation
- Sleep Duration
- Quality of Sleep
- Physical Activity Level
- Stress Level
- BMI Category
- Blood Pressure
- Heart Rate
- Daily Steps
- Sleep Disorder (Target Variable)
The dataset was collected and stored in CSV format for analysis.
- Handling missing values
- Removing duplicate records
- Data formatting and transformation
Data visualization and statistical analysis were performed to identify relationships between lifestyle factors and sleep disorders.
Relevant features were selected and categorical variables were encoded to prepare the dataset for machine learning models.
Several machine learning algorithms were implemented and compared:
- Logistic Regression
- Decision Tree
- Random Forest
The models were evaluated using performance metrics such as:
- Accuracy
- Precision
- Recall
- F1 Score
- Confusion Matrix
A Power BI dashboard was created to visualize important insights from the dataset, including:
- Sleep disorder distribution
- Occupation vs sleep disorder
- Stress level impact on sleep
- Sleep duration analysis
- Lifestyle vs sleep patterns
- Python
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Scikit-learn
- Power BI
- Jupyter Notebook
Predicting-Sleep-Disorders/
dataset/
└── sleep_dataset.csv
notebooks/
└── sleep_analysis.ipynb
models/
└── trained_models.pkl
dashboard/
└── sleep_dashboard.pbix
README.md
The machine learning models were able to identify patterns between lifestyle habits and sleep disorders. Among the tested models, Random Forest produced better predictive performance compared to other models.
- Hyperparameter tuning for better accuracy
- Implementation of deep learning models
- Using larger and more diverse datasets
- Building a real-time sleep disorder prediction system