DiabetesPrediction is a machine learning project aimed at predicting the occurrence of diabetes in patients based on various medical factors. The project uses a variety of models and techniques to provide accurate predictions.
This project is designed to predict diabetes using machine learning algorithms. It utilizes the Pima Indians Diabetes Database, which includes several medical predictor variables and one target variable, Outcome. The goal is to build a model that accurately predicts whether a patient has diabetes.
DiabetesPrediction/
├── manage.py
├── requirements.txt
├── diabetes_prediction/
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── prediction/
│ ├── migrations/
│ │ └── ...
│ ├── templates/
│ │ └── ...
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── models.py
│ ├── tests.py
│ └── views.py
└── static/
└── ...
- manage.py: Django's command-line utility for administrative tasks.
- requirements.txt: File listing the Python dependencies for the project.
- diabetes_prediction/: Django project directory containing settings and configuration.
- settings.py: Django settings and configuration file.
- urls.py: URL routing configuration.
- wsgi.py: WSGI application entry point.
- prediction/: Django app directory for the prediction functionality.
- migrations/: Directory for database migrations.
- templates/: Directory for HTML templates.
- admin.py: Django admin configuration.
- apps.py: Django app configuration.
- models.py: Django models for the app.
- tests.py: Unit tests for the app.
- views.py: Views handling web requests and responses.
- static/: Directory for static files (e.g., CSS, JavaScript).
The dataset used in this project is the Pima Indians Diabetes Database, which can be found on Kaggle. It contains the following attributes:
- Pregnancies
- Glucose
- Blood Pressure
- Skin Thickness
- Insulin
- BMI
- Diabetes Pedigree Function
- Age
- Outcome (target variable)
- Python
- Django
- MongoDB
- Jupyter Notebook
- SKLearn
- HTML
- CSS
- Clone the repository:
git clone https://github.com/JSM2512/DiabetesPrediction.git
- Navigate to the project directory:
cd DiabetesPrediction
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install the required dependencies:
pip install -r requirements.txt
- Apply the database migrations.
python manage.py migrate
- Create a superuser to access the Django admin.
python manage.py createsuperuser
- Run the Django development server.
python manage.py runserver
- Open your web browser and go to http://127.0.0.1:8000/ to access the web interface for diabetes prediction.
- Access the Django admin interface at http://127.0.0.1:8000/admin/ to manage the application data.
The following models have been implemented in this project:
- Random Forest
- K-Nearest Neighbors (KNN)
The performance of each model is evaluated using various metrics such as accuracy, precision, recall, and F1-score. The results are compared to determine the best-performing model.