← back to amine el moumen

DiabPredict — Diabetes Risk Prediction

PythonPandasScikit-learnMatplotlibJupyter Notebook

A supervised machine learning project that predicts diabetes risk from standard health indicators (glucose level, BMI, age, blood pressure, and similar features), built as an exploratory-to-production pipeline: data exploration, feature engineering, model training, and an interactive results view.

The problem & constraints

Diabetes risk prediction is a well-studied classification problem, but the real work is in the details that determine whether a model is trustworthy: handling imbalanced classes (far fewer positive cases than negative in typical datasets), avoiding features that leak the label, and presenting results in a way a non-technical reader could still sanity-check.

Approach

  • Exploratory data analysis to understand feature distributions and correlations before touching any model.
  • Feature engineering on the raw health indicators to improve signal (handling missing/invalid values, scaling, and derived features).
  • Trained and compared multiple supervised classifiers using Scikit-learn, evaluating with metrics appropriate for an imbalanced medical dataset (not just raw accuracy).
  • Built an interactive visualization layer for results: ROC curve and confusion matrix, so model performance is inspectable rather than a single opaque score.

Trade-offs made

  • Interpretable, well-understood classifiers over a black-box ensemble: for a health-risk use case, being able to reason about why the model flags a case as high-risk mattered more than squeezing out marginal accuracy gains from a harder-to-interpret model.
  • ROC/confusion-matrix visualization over a single accuracy number: accuracy alone is misleading on imbalanced medical data; showing the full confusion matrix and ROC curve makes the model's actual trade-off between false positives and false negatives visible.

Results

Delivered a working classification pipeline with an interactive dashboard for inspecting model performance (ROC curve, confusion matrix) rather than a single summary metric — the emphasis was on making results auditable, not just producing a number.

What I'd do differently

Add cross-validation with stratified folds from the start (rather than a single train/test split) to get a more reliable performance estimate on an imbalanced dataset, and compare against a calibrated probability output instead of raw class predictions.