Inspiration

Managing diabetes in ICU patients is critical for patient outcomes. We were inspired by the opportunity to use real-world ICU data to build a machine learning model that could help clinicians identify patients at risk of diabetes mellitus, potentially improving care and saving lives.

What it does

Our solution is a machine learning pipeline that:

Cleans and preprocesses ICU patient data

Trains a model to predict whether a patient has diabetes mellitus

Evaluates the model using robust metrics (accuracy, precision, recall, F1, AUC)

Can be used to classify new patient records with the trained model

How we built it

We used MATLAB for the entire workflow. The main steps were:

Data Cleaning: Removed uninformative columns (IDs, all-zero columns), handled missing values by removing columns with too many missing entries and imputing the rest with the median, and filtered out low-variance features.

Splitting: Divided the cleaned data into training and test sets (80/20 split).

Model Training: Trained a Random Forest (ensemble) classifier, using class weights to address class imbalance.

Evaluation: Evaluated the model using a confusion matrix and calculated accuracy, precision, recall, F1 score, and AUC.

Challenges we ran into

The biggest challenge was handling class imbalance. Our initial models always predicted the majority class ("no diabetes"), resulting in misleadingly high accuracy but poor recall for diabetic patients. We addressed this by introducing class weights and switching to more robust ensemble models. Ensuring consistent data cleaning and feature handling between training and test/new data was also tricky and required careful scripting.

Accomplishments that we're proud of

We built a fully automated, script-based machine learning pipeline.

We learned to address real-world data challenges, especially class imbalance and missing data.

Our final model achieved reasonable accuracy and, more importantly, improved recall and F1 score for detecting diabetes.

What we learned

Basic machine learning workflow: data cleaning, feature selection, model training, and evaluation.

The importance of using multiple metrics (not just accuracy) for imbalanced datasets.

How to implement class weighting and decision tree methods in MATLAB.

The critical need for consistent preprocessing between training, test, and new data.

What's next for Machine Learning - Predicting Diabetes

Improving metrics: We plan to further tune the model for higher recall and precision, possibly by trying advanced ensemble techniques or hyperparameter optimization.

Feature engineering: Exploring new features or combining existing ones to improve predictive power.

Deployment: Wrapping the pipeline into a user-friendly tool for clinicians.

Explainability: Adding feature importance analysis to help understand what drives predictions.

Validation: Testing the model on external datasets to ensure generalizability.

Built With

Share this project:

Updates

Submission history