NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Capstone > Diabetic Patients - Predicting Early Readmissions

Diabetic Patients - Predicting Early Readmissions

Yi Cao
Posted on Feb 4, 2021

The skills the author demonstrated here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

Authors: Yi Cao, Matt Hope, Ava Park

Introduction - Pt. 1

The cost of healthcare in the United States is much higher than that in other developed countries and is on track to continue growing as a portion of gross domestic product, despite efforts to rein in cost. Given the challenges in the healthcare sector, data science as a field has a role to play in producing actionable insights to bring down costs and improve outcomes for patients. In this capstone project, our team combined both data analysis and machine learning techniques to predict early hospital readmission in diabetic patients across the country.

Diabetes is a prevalent and costly disease in the United States, but recent numbers from the American Diabetic Association (ADA) have illuminated the extent of the problem. For example, 25 million adult Americans (9.8% of the population) are estimated to have diagnosed diabetes, making it one of the most common medical conditions. Furthermore, in 2017, the ADA estimated that 277,000 deaths were attributable to the disease.

Introduction - Pt. 2

Diabetes is a chronic condition that frequently co-occurs with other conditions, such as heart disease, kidney disease, high blood pressure, or stroke. Therefore, 85,000 of those deaths were directly attributable to diabetes, while the majority listed other comorbid conditions as the primary cause.

In addition to its impact on the health of patients, diabetes also has a tremendous impact on the cost of care associated with treating patients. The ADA reports that in 2017, diabetes incurred approximately $237 billion in direct healthcare costs, and an additional $90 billion dollars in lost economic productivity from patients. Healthcare spending on diabetes has increased substantially in the last decade, and itโ€™s estimated that one out of every four healthcare dollars is spent on patients with diabetes.

As mentioned above, diabetes is a chronic condition, with some patients managing well and other patients requiring frequent trips to the hospital. Inpatient hospital visits represent a significant driver of healthcare costs, and hospitals are incentivized to prevent early and/or frequent readmission of patients. As part of this project, we took on the role of data scientists making recommendations to a hospital working with diabetic patients.

Since resources are typically limited, hospitals must choose which patients to target for intervention, either during their inpatient stay or after they are discharged for preventative measures. The goal of our project was two-fold: we wanted to explore which attributes of a patient are correlated with readmissions, and then we built a supervised machine-learning model to help hospitals predict whether a patient will be readmitted within 30 days.

 

Data Description About Diabetic Patients

Our dataset is an extract from the Health Facts database representing 10 years (1999-2008) of clinical care data at 130 hospitals and integrated delivery networks throughout the United States. The data was extracted based on these criteria:

  • The record was an inpatient encounter (a hospital admission).
  • Diabetes was entered into the system as a diagnosis.
  • The length of stay was >= 1 day and <= 14 days.
  • Laboratory tests were performed during the encounter.
  • Medications were administered during the encounter.

After some cleaning, our dataset consisted of 69,970 unique encounters, with each representing a patient. We modeled our target as a binary variable, where the patient either was or was not readmitted within 30 days. The features contained within the dataset include basic demographics such as age, gender, and race, as well as features indicating patient diagnoses, medications, and medical history.

In the case of patient diagnoses, we discovered that these features were encoded by International Statistical Classification of Diseases (ICD) numbers, which represent a multitude of different medical conditions. Given the high cardinality of these features, we focused our attention on conditions that had more than 500 patients in our dataset, and similarly focused on medications that had at least 500 patients prescribed. These choices ultimately led to a cleaned dataset with 93 distinct features, which we examined with exploratory data analysis.

 

Exploratory Analysis (EDA) on Diabetic Patients

We examined each of the patient encounter features in relation to our binarized target variable, โ€˜readmit_30dโ€™: whether a patient was readmitted within 30 days or not. Below we have summarized features that we observed a relatively strong correlation with readmit_30d. The vertical bars in the plots represent the 95% confidence intervals.

  • โ€˜ageโ€™ (age groups): patients aged 60 or above, especially those between 70 and 90, were more likely to be rehospitalized early than patients in the other age groups.

Diabetic Patients - Predicting Early Readmissions

  • โ€˜discharge_disposition_idโ€™ (where patients were discharged to after the encounter): patients who were discharged to another type of inpatient care institution (id 5) or to another rehab facility (id 22) had a much higher chance to be rehospitalized early

Diabetic Patients - Predicting Early Readmissions

  • โ€˜num_diagnosesโ€™ (number of diagnoses entered into the system): patients who ended up rehospitalized early had had more diagnoses on average entered into the record for their prior encounter.

Diabetic Patients - Predicting Early Readmissions

  • โ€˜num_medicationsโ€™ (number of distinct, generic medications administered during the encounter): patients who ended up rehospitalized early had been put on more medications on average during their prior encounter.

  • โ€˜num_lab_proceduresโ€™ (number of lab tests performed during the encounter): patients who ended up rehospitalized early had been given more lab tests on average during their prior encounter.

  • โ€˜num_emergencyโ€™ (number of emergency visits in the year preceding the encounter): patients who ended up rehospitalized early had a higher average number of emergency visits in the previous year.

  • โ€˜num_inpatientโ€™ (number of inpatient visits in the year preceding the encounter): patients who ended up rehospitalized early had a higher average number of inpatient visits in the previous year.

 

Model Testing with Decile Analysis - Pt. 1

Using our findings from the EDA, we then constructed a simple logistic model with 6 input variables and no regularization or parameter tuning. The six variables are: 

  • Discharged to...
    • A rehabilitation facility
    • Another type of inpatient care institution
    • To home
  • Number of...
    • Inpatient visits
    • Emergency visits
  • Age

This model tested an AUC-ROC score of 0.595 and a max lift of 2.30 from the decile analysis. It indicated that the simple model could distinguish the true and false classes to an extent, and especially in the highest-risk patient group (stratified based on the model) - more than twice as many patients were classified correctly than not using any model. 

Encouraged by this result, we then ran a few other supervised machine-learning models to explore ways to further improve the model score. We summarized the model test outcomes in the table below. For each of these models, we have conducted their own decile analysis to look at model performance - how much better we can predict readmission with the model.

Model

# of features 

Features selected via:

Class imbalance remedy

AUC-ROC (train and test)

Cum lift from 10th decile 

Simple Logistic Regression

6

EDA

class_weight = โ€˜balancedโ€™

0.59642

0.59472

2.30x

Regularized Logistic Regression

43

The top 43 features from a full model with 93 features

class_weight = โ€˜balancedโ€™

0.61060

0.60277

2.25x

Decision Tree

43

The top 43 features from a full model with 93 features

class_weight = โ€˜balanced subsampleโ€™

0.60496

0.59289

2.13x

Random Forest

43

The top 43 features from a full model with 93 features

class_weight = โ€˜balanced subsampleโ€™

0.61193

0.60361

2.27x

Gradient Boost

43

The top 43 features from a full model with 93 features

Random oversampling

0.63008 

0.60956 

2.41x

Model Testing with Decile Analysis - Pt. 2

All of the more complex models demonstrated similar predicting capabilities, with AUC-ROC scores hovering over 0.60. The best test performance came from using a gradient boost classifier, which yielded a test AUC-ROC score of 0.610 and a max lift of 2.41.

In addition, the features that were deemed more โ€˜importantโ€™, either by the coefficients or feature importances, were fairly consistent across these models. We observed that while some features such as the number of inpatient/emergency visits, discharging to a rehabilitation facility/other inpatient care facility, or the number of lab procedures were positively correlated with the probability of readmission, other features like a respiratory symptom diagnosis or a back/neck pain diagnosis seemed to be more โ€˜protectiveโ€™ of being rehospitalized. 

Cost Analysis

To determine which model, we would recommend a hospital using in order to target patients for health intervention, we conducted a cost analysis for the simple model and for the gradient boost model, using the cost figures from a study by the American Diabetes Association (see figure below). 

On average, the annual cost of inpatient care for a diabetes-related hospitalization was $2,820 for patients of all ages, and $4,075 for those 65 and above. The simple model predicted 163 out of the 289 patientsโ€™s readmission in the highest-risk group (10th decile) correctly. If these 163 patients could be diverted from a readmission through a certain intervention, it could reduce approximately $460K in inpatient care costs for patients of all ages or $664K if all the patients were 65 and above.

Similarly, using the gradient boost model could reduce the inpatient care costs by $499K for patients of all ages or $721K if all of them were 65 and above. Although the AUC-ROC scores were similar between the simple and the gradient-boost model, we could see that if both models were implemented, the gradient boost model had a much higher potential in reducing the diabetic-related inpatient-care costs than the simple model, likely due to the high marginal healthcare expenditure. 

Conclusion About Diabetic Patients - Pt. 1

Our exploration and analysis yielded several models of varying complexity, from a very simple logistic regression model to a gradient boosted tree-based model. The AUC-ROC scores for the models were very similar, with the more complex models showing a marginally better score compared to the simple one.

This raises an important question: should a hospital implement the simple model to track diabetic patients, or is the marginal increase in the AUC-ROC score worth it to implement a more complex model? In sectors outside of healthcare, itโ€™s likely that the simple model would be preferableโ€” however, we found that the high cost of care for diabetic patients makes even small increases in the AUC-ROC worthwhile. 

Based on our estimations, the difference in cost savings between the simple and complex model was $39K per year for the general diabetic population, and $57K for a population 65 and older. Therefore, the potential savings of implementing a more complex model could be substantial, which underscores the importance of carefully following through with cost analysis.

Conclusion About Diabetic Patients - Pt. 2

We note that the amount of money saved by a hospital will depend on several factors, primarily: the patient population they serve, the effectiveness and cost of intervention, and the cost of implementing and tracking the features in the more complex model. Therefore, we expect that the decision of what model to implement would vary from hospital to hospital, depending on their particular needs.

Lastly, we want to point out that features that were deemed to be important are broadly consistent across the models and logically interpretable. For instance, features that indicate previous interactions with the healthcare system, like the number of inpatient hospital visits, were strongly correlated with rehospitalization. Some of the features deemed to be important were more unexpected but still interpretable, such as being discharged to a rehabilitation facility, or being diagnosed with a cough and/or musculoskeletal problems.

These results might suggest to the hospital how to go about implementing an intervention. For instance, our models would suggest paying special attention to patients discharged to rehabilitation facilities, to make sure their blood sugar is controlled while receiving treatment for addiction. In this way, we envision data scientists playing a useful role in both building models and implementing them in the real world, in order to bring down healthcare costs and improve care.

 

About Author

Yi Cao

View all posts by Yi Cao >

Leave a Comment

No comments found.

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application