Skip to content

lemancaliskan/SleepMetrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒ™ SleepMetrics - Sleep Health & Lifestyle Analysis Tool

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.

Streamlit


πŸ“Ί Demo

🎨 Visual Experience

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.

πŸ” Desktop Application (EN/TR)

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.

TURKISH UI:
image

ENGLISH UI:
image

🌐 Web Application (Streamlit):

A responsive and lightweight web version for instant access from any device. image


✨ Features

  • Dual Language Support: Optimized interfaces for both English (EN) and Turkish (TR).

  • Modern GUI: A sleek design powered by CustomTkinter with 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.


🧬 Technical Architecture

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 RandomForest and Gradient Boosting models are managed via joblib

  • Assets Manager: Handles dynamic asset loading (icons, logos) for a consistent UI experience.


πŸ“Š Data Foundation

The intelligence of SleepMetrics is built upon a synthesis of high-quality health and productivity data:


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.


βš™οΈ Backend Engine

The analytical core utilizes two specialized machine learning models trained on the "Sleep Health and Lifestyle" dataset:

image
  • 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 SleepEngine training pipeline:

    • Sleep Quality Prediction Accuracy (R2): 99.08%

    • Sleep Disorder Diagnosis Accuracy: 88.00%


πŸš€ Live Demo (Web Version)

You can now try the application directly in your browser without any installation: Go to the SleepMetrics Streamlit App


πŸ› οΈ Installation & Usage

  • 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 .csv files 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.py

πŸ“ Project Structure

SleepMetrics/
β”œβ”€β”€ πŸ“ 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 information

🀝 Contributing

Contributions 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 Request

⚠️ Medical Disclaimer

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


βš–οΈ License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

Sleep Health & Lifestyle Analysis Tool: An AI-powered desktop application that analyzes biometric data to predict sleep quality and detect potential sleep disorders using machine learning models.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages