RSS Amplifier

Danica's Substack | Data Science, AI & Career · Aug 18, 2026

Building a Hospital Readmission Prediction System using Logistic Regression + LightGBM

0
Sign in to vote or save

Danica Simic · Danica's Substack | Data Science, AI & Career

Most aspiring data scientists and ML engineers I meet want to work in healthcare. And that’s wonderful. Here’s a project you can build, show real problem-solving skills and impress the recruiters.

If you are trying to break into data science or machine learning, you have probably heard the same advice a hundred times. Build a portfolio. Show real projects. Prove you can do the work, not just talk about it. The advice is correct, but it rarely comes with a real example of what a strong project actually looks like from start to finish.

I’m walking you through one complete project: predicting whether a hospital patient will be readmitted within 30 days of discharge. We will go through every stage together, from raw data to a deployed, working demo. Along the way, I will show you the code, the decisions behind each step, and the mistakes I made so you do not have to make them yourself.

By the end, you will have a template you can adapt to your own portfolio project. That said, you’ll be able to build your own independent projects within your industry, along with a clear understanding of why each step matters and not just how to run it.

When building portfolio, don’t just think about your technical skills. The portfolio is also supposed to show employers that you can identify a meaningful problem, work with imbalanced data and turn your solution into something people can actually use (they don’t have anything from Titanic survival prediction)

Avoid overused beginner projects such as Titanic survival or Iris flower classification. They are useful for learning the basics, but thousands of candidates have already built them, so they rarely make a portfolio stand out.

Instead, choose a project that:

  • Solves a real-world problem. The value of the project should be immediately clear to a hiring manager.

  • Uses realistically messy data. Look for missing values, duplicate records, inconsistent formats, or features that require thoughtful cleaning and preparation.

  • Requires meaningful decisions. You should be able to explain how you defined the target, selected features, evaluated the model, and handled trade-offs.

  • Goes beyond model training. Deploy the solution as an interactive app, API, dashboard, or another format that people can actually test.

Hospital readmission prediction is a strong example because it checks every box:

  • It addresses a genuine healthcare problem. Hospitals actively try to reduce avoidable readmissions, partly because Medicare financially penalizes high 30-day readmission rates.

  • The data is realistically complicated. It may contain missing values, repeated patients, inconsistent records, and a target variable that must be redefined before modelling.

  • It can become a complete product. The final model can be deployed as a small interactive app that allows users to enter patient information and explore the predicted risk of readmission.

Before building the project, it is worth understanding the mistakes that commonly make portfolio work look less credible. Avoiding them demonstrates that you understand not only how to train a model, but also how to build and evaluate one properly.

  • Relying on accuracy alone. On an imbalanced dataset, where one outcome is much less common than the other, a model can achieve high accuracy while failing to identify the cases that actually matter. Use metrics such as precision, recall, F1-score, and ROC-AUC to evaluate performance more meaningfully.

  • Splitting the data without considering repeated patients. Some patients appear multiple times because they were admitted on separate occasions. With a random split, records belonging to the same patient could appear in both the training and test sets. This gives the model information about patients it is later tested on, causing data leakage and artificially inflated results.

  • Skipping model interpretability. A risk score without an explanation is unlikely to earn the trust of a hospital—or a serious employer. Use feature importance, SHAP values, or another interpretability method to show which factors influenced each prediction. Demonstrating that you understand why the model behaves as it does can be more impressive than the accuracy score itself.

This project turns raw hospital data into a working readmission risk tool. We will:

  • Clean and explore more than 100,000 hospital encounters.

  • Create visuals and engineer useful features.

  • Build a baseline model before training a stronger LightGBM model.

  • Evaluate both models using appropriate metrics for imbalanced data.

  • Use SHAP to explain the final predictions.

  • Deploy the model as a free interactive app.

The dataset is public, the libraries are open source, and the deployment platform is free—so you can reproduce the entire project without spending anything.

Read the original on danicasimic.substack.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.