A machine learning project that predicts whether a person is diabetic or not based on diagnostic health measurements, using the PIMA Indians Diabetes Dataset and a Support Vector Machine (SVM) classifier.
This project aims to build a binary classification model that can predict the likelihood of diabetes in a patient. It covers the full ML pipeline — from data loading and exploration to model training, evaluation, and a real-time predictive system.
- Name: PIMA Indians Diabetes Dataset
- Source: Originally from the National Institute of Diabetes and Digestive and Kidney Diseases
- Records: 768 patients (female, at least 21 years old of Pima Indian heritage)
- Target Column:
Outcome—0= Non-Diabetic,1= Diabetic
| Feature | Description |
|---|---|
| Pregnancies | Number of times pregnant |
| Glucose | Plasma glucose concentration |
| BloodPressure | Diastolic blood pressure (mm Hg) |
| SkinThickness | Triceps skinfold thickness (mm) |
| Insulin | 2-Hour serum insulin (mu U/ml) |
| BMI | Body mass index |
| DiabetesPedigreeFunction | Diabetes pedigree function score |
| Age | Age in years |
- Language: Python 3
- Libraries:
numpy— numerical operationspandas— data loading and analysisscikit-learn— preprocessing, model training, and evaluation
1. Data Collection & Loading
↓
2. Exploratory Data Analysis (EDA)
↓
3. Data Standardization (StandardScaler)
↓
4. Train-Test Split (80% train / 20% test)
↓
5. Model Training (SVM — Linear Kernel)
↓
6. Model Evaluation (Accuracy Score)
↓
7. Predictive System (single-instance prediction)
- Algorithm: Support Vector Machine (SVM) with a linear kernel
- Train-Test Split: 80% training, 20% testing (stratified split,
random_state=2) - Preprocessing: Feature standardization using
StandardScaler
| Dataset | Accuracy |
|---|---|
| Training Data | ~78–79% |
| Test Data | ~77–78% |
Exact values may vary slightly based on environment.
input_data = (5, 166, 72, 19, 175, 25.8, 0.587, 51)
# Output: The person is diabeticThe input is reshaped, standardized using the same scaler fitted on training data, and passed to the trained SVM model for prediction.
-
Clone the repository
git clone https://github.com/Mdwali79986/PROJECT_Diabetes-Prediction-using-Machine-Learning.git cd PROJECT_Diabetes-Prediction-using-Machine-Learning -
Install dependencies
pip install numpy pandas scikit-learn
-
Add the dataset
- Download
diabetes.csvfrom Kaggle – PIMA Diabetes Dataset - Place it in the project directory
- Download
-
Run the notebook
jupyter notebook Project_Diabetes_Prediction.ipynb
diabetes-prediction/
│
├── Project_Diabetes_Prediction.ipynb # Main notebook
├── diabetes.csv # Dataset (not included — add manually)
└── README.md # Project documentation
Md Waliullah
This project is open-source and available under the MIT License.