Analysis #10
diabetes.csv · 768 rows × 9 columnsClassify patients into risk categories.
Objective partially fulfilled
The objective was partially met. F1 of 0.7462 is usable but leaves real room to improve. Success criterion: A model that clearly beats the naive baseline on F1 and behaves sensibly on the outcome the objective cares about.
-
Predictive quality
F1 of 0.7462 is usable but leaves real room to improve. -
Beats the naive baseline
The trivial baseline scores 0.5113 and the chosen model scores 0.7462 - an improvement of 0.2349. -
Catches the minority class
It correctly identifies 63.0% of the '1' cases, which is the class the objective cares about. -
Stable across folds
5-fold cross-validation gives 0.6956 (± 0.0417) against a test score of 0.7462, so the result is consistent.
Dataset overview

Columns the agent found
first 25 shown| Column | Detected as | Type | Missing | Unique | Examples |
|---|---|---|---|---|---|
Pregnancies |
numeric | int64 | 0.0% | 17 | 6, 1, 8 |
Glucose |
numeric | int64 | 0.0% | 136 | 148, 85, 183 |
BloodPressure |
numeric | int64 | 0.0% | 47 | 72, 66, 64 |
SkinThickness |
numeric | int64 | 0.0% | 51 | 35, 29, 0 |
Insulin |
numeric | int64 | 0.0% | 186 | 0, 94, 168 |
BMI |
numeric | float64 | 0.0% | 248 | 33.6, 26.6, 23.3 |
DiabetesPedigreeFunction |
numeric | float64 | 0.0% | 517 | 0.627, 0.351, 0.672 |
Age |
numeric | int64 | 0.0% | 52 | 50, 31, 32 |
Outcome |
binary | int64 | 0.0% | 2 | 1, 0 |
Data quality
score 100/100- none No significant data quality problems detected.
Cleaning summary
0 action(s) takenBefore cleaning
After cleaning
What was done
- Nothing needed fixing — the file was already clean.
Problem framing and features
split before engineering, so nothing leaksOutcomeThe target has exactly two distinct values, so this is binary classification.
Using F1 as recommended by the AI analyst for this objective.
Stratified 80/20 split with random_state=42, so both splits keep the same class balance.
Strongest signal against the target
Engineered features
14| Feature | Type | Why |
|---|---|---|
Insulin_log | log transform | Insulin is right-skewed (skew 2.03); a log transform pulls in the long tail so linear models are not dominated by outliers. |
DiabetesPedigreeFunction_log | log transform | DiabetesPedigreeFunction is right-skewed (skew 1.82); a log transform pulls in the long tail so linear models are not dominated by outliers. |
Glucose_per_BMI | ratio | Ratio of two of the most informative numeric columns. Ratios capture relative size, which raw values on their own cannot. |
Glucose_minus_BMI | difference | Gap between Glucose and BMI; differences often matter more than either value alone. |
Glucose_per_Age | ratio | Ratio of two of the most informative numeric columns. Ratios capture relative size, which raw values on their own cannot. |
Glucose_minus_Age | difference | Gap between Glucose and Age; differences often matter more than either value alone. |
Glucose_per_Insulin | ratio | Ratio of two of the most informative numeric columns. Ratios capture relative size, which raw values on their own cannot. |
Glucose_minus_Insulin | difference | Gap between Glucose and Insulin; differences often matter more than either value alone. |
BMI_per_Age | ratio | Ratio of two of the most informative numeric columns. Ratios capture relative size, which raw values on their own cannot. |
BMI_minus_Age | difference | Gap between BMI and Age; differences often matter more than either value alone. |
BMI_per_Insulin | ratio | Ratio of two of the most informative numeric columns. Ratios capture relative size, which raw values on their own cannot. |
BMI_minus_Insulin | difference | Gap between BMI and Insulin; differences often matter more than either value alone. |
Age_per_Insulin | ratio | Ratio of two of the most informative numeric columns. Ratios capture relative size, which raw values on their own cannot. |
Age_minus_Insulin | difference | Gap between Age and Insulin; differences often matter more than either value alone. |
Removed features
5| Feature | Reason |
|---|---|
DiabetesPedigreeFunction | Correlated 0.988 with DiabetesPedigreeFunction_log, which carries the same information and scores higher against the target. |
Glucose_minus_BMI | Correlated 0.969 with Glucose, which carries the same information and scores higher against the target. |
Insulin | Correlated 0.956 with Glucose_minus_Insulin, which carries the same information and scores higher against the target. |
Glucose_minus_Insulin | Correlated 0.957 with BMI_minus_Insulin, which carries the same information and scores higher against the target. |
Age_minus_Insulin | Correlated 0.992 with BMI_minus_Insulin, which carries the same information and scores higher against the target. |
Models trained and compared
ranked on F1, not on accuracy by default
The AI layer suggested model names; the agent resolved each one against a fixed library of hand-written models and refused anything that did not fit.
| Model | Accuracy | Precision | Recall | F1 | ROC-AUC | Time (s) |
|---|---|---|---|---|---|---|
| Logistic Regression | 0.7143 | 0.7065 | 0.7143 | 0.7084 | 0.8369 | 0.051 |
| Decision Tree Classifier best | 0.7468 | 0.7457 | 0.7468 | 0.7462 | 0.7911 | 0.03 |
| Random Forest Classifier | 0.7208 | 0.7140 | 0.7208 | 0.7158 | 0.8154 | 0.582 |
| Extra Trees Classifier | 0.7338 | 0.7275 | 0.7338 | 0.7290 | 0.8072 | 0.352 |
| K-Nearest Neighbors Classifier | 0.7078 | 0.7005 | 0.7078 | 0.7026 | 0.7244 | 0.033 |
| Baseline (Most Frequent Class) baseline | 0.6494 | 0.4217 | 0.6494 | 0.5113 | 0.5000 | 0.022 |
The selected model
Decision Tree Classifier
F1 0.7462Decision Tree Classifier achieved the best F1 of 0.7462, ahead of Extra Trees Classifier (0.7290) by 0.0172. F1 was chosen because it matches what the objective is asking for.
Captures non-linear rules and is easy to explain to a non-technical audience.

Performance on each class
a high overall score can still hide a class the model never finds| Class | Rows in test set | Correctly identified | How well it is caught |
|---|---|---|---|
0 |
100 | 81.0% |
|
1 |
54 | 63.0% |
|
What drives the predictions
Impurity-based importance
How much each feature reduced prediction error across all the splits in the trees. Higher means the model relied on it more.
| # | Feature | Share |
|---|---|---|
| 1 | Glucose |
35.21% |
| 2 | BMI |
13.8% |
| 3 | Glucose_per_Age |
7.17% |
| 4 | BloodPressure |
6.45% |
| 5 | Age |
6.41% |
| 6 | Glucose_minus_Age |
5.15% |
| 7 | BMI_minus_Age |
5.08% |
| 8 | Pregnancies |
4.51% |
| 9 | DiabetesPedigreeFunction_log |
4.47% |
| 10 | Glucose_per_BMI |
3.4% |
Insights and next steps
- The winning model's decisions are driven mainly by Glucose (35%), BMI (14%), Glucose_per_Age (7%).
- The objective was partially met. F1 of 0.7462 is usable but leaves real room to improve. Success criterion: A model that clearly beats the naive baseline on F1 and behaves sensibly on the outcome the objective cares about.
- Collect more data. 768 rows is a small sample, and the score above could move considerably on a larger one.
- Try adjusting the decision threshold rather than the model. Moving it away from 0.5 trades precision for recall and often fixes a model that is accurate but never flags the class you care about.
- If the classes are imbalanced, resampling the training data or class weighting is usually a bigger win than switching algorithms.
- Tune Decision Tree Classifier with a grid or randomised search. This run used sensible defaults with no hyperparameter search, so there is headroom left.
- Review the 5 removed feature(s) with a domain expert. Automated selection is statistical; it does not know which columns matter to the business.
- Before deploying, re-test on data from a later time period than the training data. A random split cannot tell you whether the pattern holds next quarter.
'Outcome' scored highest as a target candidate because column name is exactly 'outcome'; last column in the file; two distinct values (binary outcome). The objective wording suggests a classification task. Identifier and constant columns were excluded because they cannot generalise. This recommendation was produced by the built-in rule-based analyst rather than Gemini.
Success criterion it set: A model that clearly beats the naive baseline on F1 and behaves sensibly on the outcome the objective cares about.
- Gemini was not used for this run: google-genai package is not installed.

The written report goes further than this dashboard
Executive summary, every decision explained, the full metric tables, limitations and recommended next steps — written for technical and non-technical readers at once.
Open the full report