# ๐ค DiabeticsAI Enterprise
### Advanced Machine Learning Platform for Diabetes Risk Assessment & Health Analytics





**๐ฏ State-of-the-art AI-powered diabetes prediction platform with enterprise-grade features**
[๐ Quick Start](#-quick-start) โข [๐ Features](#-features) โข [๐ง Installation](#-installation) โข [๐ Usage](#-usage) โข [๐ค Contributing](#-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
```bash
# 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.py
```
๐ **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**
```bash
git clone https://github.com/kris07hna/diabeticsanalysit.git
cd diabeticsanalysit
```
2. **Create Virtual Environment** (Recommended)
```bash
python -m venv diabetics_env
source diabetics_env/bin/activate # On Windows: diabetics_env\Scripts\activate
```
3. **Install Dependencies**
```bash
pip install -r requirements.txt
```
4. **Verify Installation**
```bash
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
```
---
## ๐ฎ Usage
### ๐ Starting the Application
```bash
# 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.0
```
### ๐ 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
```
---
## ๐จ 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
```csv
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
```bash
# Standard deployment
streamlit run main_app_working.py
# Production mode
streamlit run main_app_working.py --server.port 80 --server.address 0.0.0.0
```
### Docker Deployment
```bash
# Build image
docker build -t diabeticsai .
# Run container
docker run -p 8501:8501 diabeticsai
```
### Cloud Deployment
- **Streamlit Cloud**: Connect GitHub repository
- **Heroku**: Use provided Procfile
- **AWS/Azure**: Deploy using container services
---
## ๐ Security & Privacy
### 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**
```bash
git checkout -b feature/amazing-feature
```
3. **Make Changes** and test thoroughly
4. **Commit Changes**
```bash
git commit -m "Add amazing feature"
```
5. **Push to Branch**
```bash
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**
```bash
# Solution: Install missing dependencies
pip install -r requirements.txt
```
**โ Port Already in Use**
```bash
# Solution: Use different port
streamlit run main_app_working.py --server.port 8502
```
**โ 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
- [Streamlit Documentation](https://docs.streamlit.io/)
- [Scikit-learn User Guide](https://scikit-learn.org/stable/user_guide.html)
- [Plotly Documentation](https://plotly.com/python/)
---
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](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.
```
---
## ๐ 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](https://github.com/kris07hna/diabeticsanalysit/issues) โข [โจ Request Feature](https://github.com/kris07hna/diabeticsanalysit/issues) โข [๐ค Contribute](https://github.com/kris07hna/diabeticsanalysit/pulls)