Skip to content
Notifications You must be signed in to change notification settings

kris07hna/diabeticsanalysit

Repository files navigation

🤖 DiabeticsAI Enterprise

Advanced Machine Learning Platform for Diabetes Risk Assessment & Health Analyticstics

Python Streamlit Machine Learning Status License

🎯 State-of-the-art AI-powered diabetes prediction platform with enterprise-grade features

🚀 Quick Start📋 Features🔧 Installation📖 Usage🤝 Contributing


🌟 Overview

DiabeticsAI Enterprise is a comprehensive machine learning platform designed for healthcare professionals, researchers, and data scientists to assess diabetes risk, analyze health patterns, and make data-driven medical decisions. Built with cutting-edge technology and featuring an intuitive dark violet-themed interface with smooth animations.

🎯 Key Highlights

  • Advanced ML Models: Multiple algorithms including Random Forest, XGBoost, Neural Networks
  • Real-time Predictions: Instant diabetes risk assessment for individual patients
  • Batch Processing: Analyze large datasets efficiently
  • Interactive Visualizations: Comprehensive charts and analytics
  • Enterprise UI: Professional dark violet theme with smooth gliding animations
  • Session Management: Persistent model storage with browser fingerprinting
  • Export Capabilities: Download predictions and visualizations

🚀 Quick Start

# Clone the repository
git clone https://github.com/kris07hna/diabeticsanalysit.git

cd diabeticsanalysit


# Install dependencies
pip install -r requirements.txt



# Launch the application
streamlit run main_app_working.pyy

🌐 Access the application: http://localhost:8501


📋 Features

🏠 Home Dashboard

  • Welcome Interface: Professional hero section with animated elements
  • Quick Stats: Real-time system metrics and performance indicators
  • Navigation Hub: Easy access to all platform features
  • System Status: Live monitoring of AI engine and database connectivity

🔮 AI Predictions

  • Individual Assessment: Single patient diabetes risk prediction
  • Batch Processing: Upload CSV files for multiple predictions
  • Model Selection: Choose from trained ML models
  • Risk Recommendations: Personalized health advice based on predictions
  • Export Results: Download prediction reports

🧪 Model Training

  • AutoML Suite: Automated machine learning with hyperparameter optimization
  • Custom Models: Train Random Forest, XGBoost, Neural Networks, Gradient Boosting
  • Data Upload: Support for CSV files and sample datasets
  • Cross-validation: K-fold validation for robust model evaluation
  • Model Comparison: Performance metrics and visualizations

📊 Analytics Dashboard

  • Interactive Charts: Plotly-powered visualizations
  • Feature Analysis: Correlation matrices and feature importance
  • Performance Metrics: Accuracy, Precision, Recall, F1-Score, ROC-AUC
  • Data Insights: Statistical summaries and distributions
  • Export Visualizations: Save charts as images

📈 Model Validation

  • Cross-validation: Comprehensive model testing
  • Confusion Matrices: Visual performance analysis
  • ROC Curves: Receiver Operating Characteristic analysis
  • Feature Importance: Understand model decision factors
  • Performance Comparison: Side-by-side model evaluation

🔧 Installation

Prerequisites

  • Python 3.8+
  • pip package manager
  • Modern web browser (Chrome, Firefox, Safari, Edge)

Step-by-Step Installation

  1. Clone the Repository

    git clone https://github.com/kris07hna/diabeticsanalysit.git
    
    cd diabeticsanalysit
  2. Create Virtual Environment (Recommended)

    python -m venv diabetics_env
    
    source diabetics_env/bin/activate  # On Windows: diabetics_env\Scripts\activate
  3. Install Dependencies

    pip install -r requirements.txt
  4. Verify Installation

    python -c "import streamlit, pandas, numpy, sklearn; print('✅ All dependencies installed successfully!')"

Dependencies

streamlit>=1.32.0
pandas>=2.0.0
numpy>=1.24.0
scikit-learn>=1.3.0
plotly>=5.15.0
xgboost>=1.7.0
seaborn>=0.12.0
matplotlib>=3.7.0
.0
matplotlib>=3.7.0
=3.7.0

🎮 Usage

🚀 Starting the Application

# Basic launch
streamlit run main_app_working.py



# Custom port
streamlit run main_app_working.py --server.port 8502



# External access
streamlit run main_app_working.py --server.address 0.0.0.00

📝 Making Predictions

  1. Navigate to AI Predictions 🔮
  2. Choose Input Method:
    • Manual Input: Enter patient data manually
    • Excel Upload: Upload CSV file with patient data
    • Batch Processing: Process multiple files
  3. Select Model: Choose from available trained models
  4. Get Results: View predictions with risk assessments
  5. Export: Download results as CSV or PDF

🧪 Training Models

  1. Go to Model Training 🧪
  2. Upload Dataset or use sample data
  3. Select Target Column (e.g., 'Diabetes_012')
  4. Choose Algorithm:
    • Random Forest
    • XGBoost
    • Neural Network
    • Gradient Boosting
  5. Configure Parameters
  6. Train Model and view results
  7. Save Model for future predictions

📊 Analyzing Data

  1. Access Analytics Dashboard 📊
  2. Upload Dataset or use existing data
  3. Explore Visualizations:
    • Distribution plots
    • Correlation heatmaps
    • Feature importance charts
  4. Generate Insights
  5. Export Visualizations

🏗️ Project Structure

diabeticsanalysit/
├── 📁 modules/                    # Core application modules
│   ├── 🔧 session_manager.py     # Session and state management
│   ├── 🎨 ui_components.py       # UI components and themes
│   ├── 🤖 model_trainer.py       # ML model training logic
│   ├── 🔮 predictions.py         # Prediction engine
│   ├── 📊 analytics.py           # Analytics and visualizations
│   ├── 📈 dashboard.py           # Dashboard management
│   ├── 📋 data_manager.py        # Data processing utilities
│   └── ⚙️ config.py              # Configuration settings
|
├── 📁 data/                      # Data storage (auto-created)
├── 📁 models/                    # Saved models (auto-created)
├── 🚀 main_app_working.py        # Main application entry point
├── 📋 requirements.txt           # Python dependencies
├── 🐳 Dockerfile                # Docker configuration
├── 📝 README.md                 # This file
└── 🔧 setup.sh                  # Setup script
  # Setup script

🎨 UI Features

Dark Violet Theme

  • Professional Design: Enterprise-grade dark violet interface
  • Smooth Animations: Gliding effects and transitions
  • Responsive Layout: Optimized for all screen sizes
  • Interactive Elements: Hover effects and visual feedback

Navigation Experience

  • Futuristic Sidebar: Animated navigation with status indicators
  • Gliding Effects: Smooth background transitions
  • Performance Metrics: Real-time system monitoring
  • Status Indicators: Color-coded operational status

🔬 Machine Learning Models

Supported Algorithms

Algorithm Use Case Strengths
Random Forest General purpose, interpretable High accuracy, feature importance
XGBoost High performance Gradient boosting, handles missing values
Neural Network Complex patterns Deep learning capabilities
Gradient Boosting Ensemble method Sequential learning, bias reduction

Model Metrics

  • Accuracy: Overall prediction correctness
  • Precision: True positive rate
  • Recall: Sensitivity measurement
  • F1-Score: Harmonic mean of precision and recall
  • ROC-AUC: Area under the receiver operating characteristic curve

📊 Data Requirements

Input Data Format

  • File Type: CSV format
  • Required Columns: Health indicators (BMI, Blood Pressure, etc.)
  • Target Column: Diabetes status (0, 1, or 2)
  • Missing Values: Handled automatically

Sample Data Structure

BMI,HighBP,HighChol,CholCheck,Smoker,Stroke,HeartDiseaseorAttack,PhysActivity,Fruits,Veggies,HvyAlcoholConsump,AnyHealthcare,NoDocbcCost,GenHlth,MentHlth,PhysHlth,DiffWalk,Sex,Age,Education,Income,Diabetes_012
25.0,0,0,1,0,0,0,1,1,1,0,1,0,2,0,0,0,0,9,6,8,0


🚀 Deployment

Local Deployment

# Standard deployment
streamlit run main_app_working.py



# Production mode
streamlit run main_app_working.py --server.port 80 --server.address 0.0.0.00

Docker Deployment

# Build image
docker build -t diabeticsai  .


# Run container
docker run -p 8501:8501 diabeticsaii

Cloud Deployment

  • Streamlit Cloud: Connect GitHub repository
  • Heroku: Use provided Procfile
  • AWS/Azure: Deploy using container services

🔒 Security & Privacyvacy

Data Protection

  • Local Processing: Data stays on your system
  • Session Isolation: User sessions are isolated
  • No External APIs: Predictions run locally
  • Secure Sessions: Browser fingerprinting for security

Best Practices

  • Use HTTPS in production
  • Implement authentication for sensitive data
  • Regular security updates
  • Audit logs for compliance

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the Repository
  2. Create Feature Branch
    git checkout -b feature/amazing-feature
  3. Make Changes and test thoroughly
  4. Commit Changes
    git commit -m "Add amazing feature"
  5. Push to Branch
    git push origin feature/amazing-feature
  6. Open Pull Request

Development Guidelines

  • Follow PEP 8 style guide
  • Add docstrings to functions
  • Include unit tests
  • Update documentation

🐛 Troubleshooting

Common Issues

❌ Import Errors

# Solution: Install missing dependencies
pip install -r requirements.txtt

❌ Port Already in Use

# Solution: Use different port
streamlit run main_app_working.py --server.port 85022

❌ Model Training Fails

  • Check data format and missing values
  • Ensure sufficient memory
  • Verify target column exists

❌ Prediction Errors

  • Train a model first
  • Check input data format
  • Verify model compatibility

📈 Performance

System Requirements

  • RAM: Minimum 4GB, Recommended 8GB+
  • CPU: Multi-core processor recommended
  • Storage: 1GB free space
  • Network: Internet for initial setup

Optimization Tips

  • Use smaller datasets for training
  • Enable GPU acceleration when available
  • Close unused browser tabs
  • Regular cache clearing

📞 Support

Getting Help

  • 📖 Documentation: Check this README
  • 🐛 Issues: Report bugs on GitHub
  • 💬 Discussions: Community forum
  • 📧 Contact: Direct email support

Resources


📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2025 DiabeticsAI Enterprise

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
e Software.

🌟 Acknowledgments

  • Streamlit Team: For the amazing web framework
  • Scikit-learn: For machine learning capabilities
  • Plotly: For interactive visualizations
  • Open Source Community: For continuous inspiration

🚀 What's Next?

Upcoming Features

  • 🔬 Advanced Analytics: More statistical tests
  • 🤖 Deep Learning: TensorFlow integration
  • 📱 Mobile App: React Native companion
  • 🔗 API Integration: RESTful API endpoints
  • 🏥 EMR Integration: Electronic Medical Records
  • 🌍 Multi-language: International support

⭐ Star this repository if you found it helpful!

Built with ❤️ by the DiabeticsAI Team

🐛 Report Bug✨ Request Feature🤝 Contribute

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages