This project is part of a machine learning course at university and involves analyzing a diabetes dataset to build a predictive model for diabetes based on various health metrics.
- The dataset is read using pandas, and summary statistics are printed to understand the data distribution.
- Missing values in features (except for the target variable Diabetic) are imputed with the median value of the respective feature.
- A Kernel Density Estimate (KDE) plot is generated to visualize the distribution of the Diabetic class.
- A histogram is plotted to show the number of diabetics in different age groups.
- KDE plots are generated for the
AGEandBMIfeatures to visualize their distributions.
- A heatmap is created to visualize the correlations between input features and the Diabetic class.
A linear regression models are built to predict the AGE feature based on various input features.
- Model LR1: Uses all features except
AGEto predictAGE. - Model LR2: Uses the NPG feature to predict
AGE. - Model LR3: Uses the
NPG,DIA, andPGLfeatures to predictAGE.
- The Mean Squared Error (MSE) and R-squared values are calculated for each model.
- Scatter plots are generated to visualize actual vs. predicted
AGEvalues.
The k-Nearest Neighbors (kNN) classifier is used to predict whether a person is diabetic.
- Different values of
kand distance metrics (euclidean,manhattan,chebyshev) are evaluated. - Performance metrics such as precision, recall, F1 score, accuracy, ROC/AUC score, and confusion matrix are calculated and visualized.
- ROC curves and confusion matrices are plotted for different values of
kand metrics to analyze the model's performance.