This project uses Logistic Regression to predict whether a patient has diabetes based on the Pima Indians Diabetes Dataset.
The project demonstrates a complete machine learning workflow, including data preprocessing, feature scaling, probability prediction, ROC curve analysis, and model evaluation.
- Dataset: Pima Indians Diabetes Database
- Target Variable: Outcome
- 0: Non-Diabetic
- 1: Diabetic
Features include:
- Pregnancies
- Glucose
- BloodPressure
- SkinThickness
- Insulin
- BMI
- DiabetesPedigreeFunction
- Age
- Python
- NumPy
- Pandas
- Matplotlib
- Seaborn
- Scikit-learn
- Jupyter Notebook
- Load the dataset
- Exploratory Data Analysis (EDA)
- Data cleaning
- Train-Test Split
- Feature Scaling using StandardScaler
- Train a Logistic Regression model
- Probability prediction
- Model evaluation
- ROC Curve and AUC Score
- Accuracy: 70.8%
- AUC Score: 0.815
- Confusion Matrix
- Classification Report
- ROC Curve
| Model | Accuracy |
|---|---|
| K-Nearest Neighbors | 79.2% |
| Decision Tree | 78.6% |
| Random Forest | 76.0% |
| Logistic Regression | 70.8% |
Although Logistic Regression achieved the lowest accuracy among the four models, it provides probability estimates and performs well according to the AUC score (0.815). This makes it a valuable baseline model and an excellent choice when interpretability and probability estimation are important.
Through this project, I learned how to:
- Train a Logistic Regression model
- Apply feature scaling using StandardScaler
- Predict class probabilities
- Evaluate a classifier using Accuracy, Precision, Recall and F1-score
- Understand ROC Curve and AUC Score
- Compare multiple machine learning algorithms
Project_04_Diabetes/
│
├── diabetes_logistic_regression.ipynb
├── diabetes.csv
├── README.md
├── requirements.txt
└── .gitignore
Taha Lazar