Downloads · 30 days
0
tamirgavriely/Classification_Regression_Clustering_Evaluation
Classification_Regression_Clustering_Evaluation is a machine learning model from tamirgavriely. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
🎥 Presentation Video:\ My video presentation - for assignment2 ------------------------------------------------------------------------
Downloads · 30 days
0
Access
Public
Updated Dec 9, 2025
Repo size
1.4 MB
Likes
0
Public
Click a slice to open those files.
.ipynb3.8 MB · 68%
From the Hugging Face model README
This project presents a full end-to-end machine learning pipeline applied to a large-scale Diabetes and Lifestyle dataset. The project was developed in two major stages:
The workflow includes: - Data cleaning
insulin_level (numeric)Can lifestyle, demographic, and health-related features accurately predict insulin levels and classify individuals into meaningful insulin risk groups?
I have raised several question which strike me as interesting topics:
EDA was conducted in order to understand the structure, distribution, and relationships within the dataset.
Here are the columns' values and their distribution looks like:
<p align="center"> <!-- style="width:400px;" --> <img src="images/diabetes_stage.png" title="tool tip here"> </p> <p align="center"> <!-- style="width:400px;" --> <img src="images/diagnosed_diabetes.png" title="tool tip here"> </p> <p align="center"> <!-- style="width:400px;" --> <img src="images/education_level.png" title="tool tip here"> </p> <p align="center"> <!-- style="width:400px;" --> <img src="images/ethnicity.png" title="tool tip here"> </p> <p align="center"> <!-- style="width:400px;" --> <img src="images/gender.png" title="tool tip here"> </p> <p align="center"> <!-- style="width:400px;" --> <img src="images/income_level.png" title="tool tip here"> </p> <p align="center"> <!-- style="width:400px;" --> <img src="images/smoking_status.png" title="tool tip here"> </p>In the numeric columns I have for each column checked the stats: mean, median, std. Moreover, I have aggregated for each column the outliers according to IQR.
MinMaxScalerA Linear Regression model was trained using all original features as a baseline.
<p align="center" > <img src="images/baseline_model_performance.jpg" title="tool tip here" style="width:600px; display:block; margin:auto;"> </p>we can see the model is quite naive, it's our baseline.
Feature importance was analyzed using model coefficients
<p align="center" > <img src="images/feature_importance.png" title="tool tip here" style="width:600px; display:block; margin:auto;"> </p>Here are 4 features I have constructed from scratched:
New Feature #1:
<p align="center"> <img src="images/fe1.jpg" title="tool tip here" style="width:600px; display:block; margin:auto;"> </p>New Feature #2:
<p align="center"> <img src="images/fe2.jpg" title="tool tip here" style="width:600px; display:block; margin:auto;"> </p>New Feature #3:
<p align="center"> <img src="images/fe3.jpg" title="tool tip here" style="width:600px; display:block; margin:auto;"> </p>New Feature #4:
<p align="center"> <img src="images/fe4.jpg" title="tool tip here" style="width:700px; display:block; margin:auto;"> </p>After applying KMEANS (n=3), I have created two more features:
New Feature #5:
cluster_id
New Feature #6:
cluster_distance_min
| Model | MAE | MSE | RMSE | R² |
|---|---|---|---|---|
| Linear Regression (FE) | ✔ | ✔ | ✔ | ✔ |
| Random Forest Regressor | ✔ | ✔ | ✔ | ✔ |
| Decision Tree Regressor | ✔ | ✔ | ✔ | ✔ |
✅ Winning Regression Model: Random Forest Regressor
Exported as winning_model.pkl
Insulin levels were converted into three classes using quantile binning: - Low - Medium - High
Macro F1-score was chosen due to class imbalance.
Here is the confusion matrix I got:
<p align="center"> <img src="images/confusion_matrix.jpg" title="tool tip here" style="width:600px; display:block; margin:auto;"> </p>The metrics I have used was accuracy.
✅ **Winning Classification Model:**LogisticRegression
Exported as winning_classification_model.pkl