A machine learning web application that predicts diabetes risk based on user-input health metrics. Built with Django and scikit-learn, this application provides real-time predictions using a trained logistic regression model.
- User-friendly web interface for inputting health metrics
- Real-time diabetes risk prediction
- Supports various health indicators including:
- Age
- Gender
- Hypertension status
- Heart disease history
- Smoking history
- BMI
- HbA1c level
- Blood glucose level
- Python 3.x
- Django
- scikit-learn
- pandas
- numpy
- HTML/CSS
- Clone the repository
git clone https://github.com/yourusername/diabetes-prediction.git
cd diabetes-prediction- Create and activate virtual environment
python -m venv venv
source venv/bin/activate # For Windows: venv\Scripts\activate- Install required packages
pip install -r requirements.txt- Run migrations
python manage.py migrate- Start the development server
python manage.py runserver- Visit
http://127.0.0.1:8000/in your web browser
- Navigate to the home page
- Fill in all required health metrics in the form
- Click the "Predict" button
- View your prediction result
The prediction model is a logistic regression classifier trained on diabetes-related health metrics. The model takes into account various factors such as BMI, age, blood glucose levels, and other health indicators to predict diabetes risk.
diabetes-prediction/
│
├── ml_app/ # Main application directory
│ ├── static/ # Static files (CSS, models)
│ │ └── model/ # Trained model files
│ ├── templates/ # HTML templates
│ ├── views.py # View functions
│ └── models.py # Django models
│
├── manage.py # Django management script
├── requirements.txt # Project dependencies
└── README.md # Project documentation
To contribute to this project:
- Fork the repository
- 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
See requirements.txt for a list of all dependencies.
- Add data visualizations for prediction insights
- Implement user authentication
- Add ability to save prediction history
- Include more detailed health metrics
- Dataset source: [(https://www.kaggle.com/datasets/iammustafatz/diabetes-prediction-dataset)]