SleepMetrics is a modern desktop application designed to analyze sleep quality and predict potential sleep disorders using advanced machine learning algorithms. By processing lifestyle and clinical data through a sleek, high-DPI interface, it provides users with data-driven insights into their sleep health.
The application features a dedicated toggle for seamless switching between light and dark modes.
Features integrated real-time gauges for the live visualization of sleep quality scores.
Optimized for a 980x666 centered window layout, this standalone application delivers a precision-focused, localized experience through a theme-aware CustomTkinter UI designed for both global and local users.
A responsive and lightweight web version for instant access from any device.

-
Dual Language Support: Optimized interfaces for both English (EN) and Turkish (TR).
-
Modern GUI: A sleek design powered by
CustomTkinterwith native Dark and Light mode support. -
Smart Analysis: Real-time risk estimation using scikit-learn models (
Gradient Boosting/Random Forest). -
Data-Driven Insights: Analyzes metrics such as heart rate, physical activity, stress levels, and BMI to provide a holistic view.
-
Medical Disclaimer System: Dynamic recommendation engine and mandatory legal disclaimer components.
The application is structured into three main layers:
-
UI Components: Custom-styled input fields, combo boxes, and dashboard elements.
-
Sleep Engine: The core logic where
RandomForestandGradient Boostingmodels are managed viajoblib -
Assets Manager: Handles dynamic asset loading (icons, logos) for a consistent UI experience.
The intelligence of SleepMetrics is built upon a synthesis of high-quality health and productivity data:
-
Sleep Health and Lifestyle Dataset : Provides the core clinical metrics including sleep duration, quality, and disorder labels.
-
Sleep Health and Lifestyle : Provides the core clinical metrics including sleep duration, quality, and disorder labels.
The data was pre-processed through a custom pipeline to normalize biometric features and handle categorical variables, ensuring the models remain robust across diverse user profiles.
The analytical core utilizes two specialized machine learning models trained on the "Sleep Health and Lifestyle" dataset:
-
Quality Model:
RandomForestRegressor(150 estimators) for precise quality scoring. -
Diagnosis Model:
GradientBoostingClassifier(150 estimators) for categorical disorder identification. -
Performance: The models have been rigorously validated through the
SleepEnginetraining pipeline:-
Sleep Quality Prediction Accuracy (R2): 99.08%
-
Sleep Disorder Diagnosis Accuracy: 88.00%
-
You can now try the application directly in your browser without any installation: Go to the SleepMetrics Streamlit App
-
Cloud Version (Recommended for quick use)
Access the web application instantly: SleepMetrics Streamlit App -
Standalone Executable
To run the app without installing Python:- Go to the Releases Page
- Download the .exe file for your preferred language (SleepMetrics_EN.exe or SleepMetrics_TR.exe)
- Ensure the
data/folder containing the.csvfiles is in the same directory. - Double-click to run
-
For Developers (Source Code)
If you want to run the project locally or contribute:
# Clone the repository
git clone https://github.com/lemancaliskan/SleepMetrics.git
# --- For Desktop (CustomTkinter) ---
pip install -r requirements-wapp.txt
# To run the Turkish version:
cd v_TR
python main.py
# To run the English version:
cd v_EN
python main.py
# --- For Web (Streamlit) ---
# (Back to root directory)
pip install -r requirements.txt
streamlit run web_app.pySleepMetrics/
βββ π assets/ # App icons and logos
βββ π data/ # CSV datasets
βββ π model/ # Trained .pkl files
βββ π v_EN/ # English Version (Desktop UI)
β βββ π main.py
β βββ π ui_components.py
βββ π v_TR/ # Turkish Version (Desktop UI)
β βββ π main.py
β βββ π ui_components.py
βββ π web_app.py # Web Application (Streamlit Implementation)
βββ π engine.py # Core ML Logic
βββ π assets_manager.py # Asset & Color Management
βββ π requirements.txt # Web/Streamlit requirements
βββ π requirements-wapp.txt # Desktop App requirements
βββ βοΈ .gitignore # Files to be ignored by Git
βββ π README.md # Project documentation
βββ βοΈ LICENSE # License informationContributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
# Fork the Project
# Create your Feature Branch
(git checkout -b feature/AmazingFeature)
# Commit your Changes
(git commit -m 'Add some AmazingFeature')
# Push to the Branch
(git push origin feature/AmazingFeature)
# Open a Pull RequestThis software is for informational purposes only. The results provided do not constitute a formal medical diagnosis. Always consult with a professional healthcare provider before making any medical decisions.
This project is licensed under the MIT License. See the LICENSE file for more details.

