0% found this document useful (0 votes)
38 views

Enhancing Hospital Resource Management: Predicting Patient Length of Stay Using Machine Learning

This project aims to enhance hospital management by predicting patients’ length of stay using the MIMIC dataset, ultimately resulting in substantial cost savings and improved resource allocation. In our initial approach, we categorized the target variable, “length of stay” into three classes: short, medium, and long. Employing classification models including Logistic Regression, Random Forests, and Gradient Boosting, we attempted to predict patient outcomes.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Enhancing Hospital Resource Management: Predicting Patient Length of Stay Using Machine Learning

This project aims to enhance hospital management by predicting patients’ length of stay using the MIMIC dataset, ultimately resulting in substantial cost savings and improved resource allocation. In our initial approach, we categorized the target variable, “length of stay” into three classes: short, medium, and long. Employing classification models including Logistic Regression, Random Forests, and Gradient Boosting, we attempted to predict patient outcomes.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Volume 8, Issue 11, November 2023 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

Enhancing Hospital Resource Management: Predicting


Patient Length of Stay Using Machine Learning
Anurag Priyadarshi Anshumaan Karna
Engineering Science (Data Science) Computer Science & Engineering IIIT
University at Buffalo Buffalo, USA Naya Raipur, Raipur, India

Abstract:- This project aims to enhance hospital known for its applicability in various healthcare analyses [6].
management by predicting patients’ length of stay using
the MIMIC dataset, ultimately resulting in substantial cost II. MOTIVATION
savings and improved resource allocation. In our initial
approach, we categorized the target variable, “length of The motivation driving this project stems from the
stay” into three classes: short, medium, and long. immense financial strain imposed on the healthcare system in
Employing classification models including Logistic the United States. In 2020, the nation’s healthcare expenditure
Regression, Random Forests, and Gradient Boosting, we surpassed an astonishing $4 trillion, with nearly a third of
attempted to predict patient outcomes. However, the initial this allocated to hospital charges and services. Understanding
results were unsatisfactory, prompting us to refine our the substantial costs associated with patient care, especially
methodology. We expanded the target variable classes to concerning the duration of hospital stays, emphasizes the
five: very short, short, medium, long, and very long, need for efficient resource management.
leading to improved accuracy in predicting short The outbreak of the COVID-19 pandemic significantly
hospital stays. In the second approach, we treated the disrupted routine healthcare services [7] [8]. Lock-downs and
length of stay as a continuous variable and employed a healthcare focus on COVID-19 treatment led to the halting
Multiple Linear Regression for modeling. Unfortunately, of critical vaccination programs against diseases like measles,
this ap- proach yielded sub-optimal results compared to polio, and meningitis. This interruption in regular healthcare
the classification techniques. We analyzed the encountered protocols endangered millions of children, underscoring the
limitations and further propose future steps to enhance urgency of efficient patient care and resource allocation.
the efficiency and accuracy of prediction models,
ultimately contributing to more effective hospital resource The pandemic highlighted the importance of
management. categorizing patients based on symptom severity. Hospitals
faced over- whelming patient influxes, necessitating a system
Keywords:- Length of Stay, MIMIC III, Classification, to prioritize admissions and allocate resources effectively [9].
Random Forest, Healthcare. This under- scored the necessity of a predictive model that
I. INTRODUCTION could categorize patients into “short”, “medium” and
“long” stays based on various metrics. Such a model would
The rising demand for healthcare, especially in ensure appropriate care and resource distribution, particularly
developed countries, is driven by an aging population. for the most critical cases.
Policymakers and healthcare organizations aim to align
financial incentives with best practices to improve patient It’s crucial to emphasize that our project does not intend
outcomes and healthcare af- fordability. Chronic diseases, to replace medical professionals, rather it aims to
linked to changing lifestyles and dietary habits, pose a complement their expertise. Recognizing that the pivotal
significant challenge, being the leading cause of mortality and period for a patient’s treatment begins upon hospital
disability in the US [1]. Conditions like obstructive admission, our model provides crucial insights for medical
pulmonary disease, type 2 diabetes, cancer, and staff to optimize resource utilization and deliver timely care.
cardiovascular diseases are burdening healthcare systems [2]. By achieving this, we strive to alleviate the strain on
Long-term hospital stays have surged over the past decade due healthcare resources and ultimately save both time and lives.
to the prevalence of chronic illnesses [2]. In the US, hospitals III. OBJECTIVE
spend over $377.5 billion annually on patient admissions
and stays [3]. Prolonged hospitalizations increase the risk Our objective is to construct two distinct models
of hospital-acquired conditions [4]. Accurately predicting a utilizing data extracted from the MIMIC database [6].
patient’s hospital stay length is crucial for efficient resource These models aim to provide predictive and exploratory
management, cost reduction, and improving patient care [4]. insights. The first model is designed to forecast the
Machine learning and data mining techniques, particularly in probability of a categorical outcome, specifically a patient’s
intensive care, show promise in optimizing healthcare resource length of stay. Patients will be categorized into various classes
management [5]. This project utilizes the MIMIC database [6], of length of stay based on their individual characteristics and

IJISRT23NOV1911 www.ijisrt.com 2027


Volume 8, Issue 11, November 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
circumstances of admission. Subsequently, we will treat the Deaconess Medical Center in Boston, Mas- sachusetts,
length of stay (target variable) as a continuous variable and covering the years from 2001 to 2012.
develop regression models using diverse regression
techniques. Following the implementation of both Comprising a total of 26 interlinked tables, the MIMIC
approaches, we will assess model performance and choose III dataset uses unique identifiers like Patient ID to establish
the optimal model based on the results obtained. The con- nections between tables. These tables offer extensive
practical application of this model in real-life scenarios is a insights into patient admissions, initial conditions upon
key consideration. admission, demographic profiles, caregiver details, prescribed
medica- tions, and various other aspects. Crucially, it also
Through predictive analysis and by considering patient includes information about the length of hospital stays for
allocation with respect to healthcare resource utilization, our patients, a key focus of our current study.
objective is to derive insights that can better inform healthcare
systems. These insights will enable proactive allocation of crit- For the purposes of this academic study, we have
ical healthcare resources and will ultimately enhance overall chosen to work with an aggregated version of the MIMIC III
patient care outcomes. dataset, conveniently accessible on Kaggle. This aggregated
version condenses the data into a single file, featuring 28
IV. DATA DESCRIPTION variables and a total of 59,000 entries.

This study employs data from the publicly available V. APPROACH


MIMIC III (Medical Information Mart for Intensive Care)
clinical database [6] as seen in Fig. 1). MIMIC datasets are A. Initial Exploratory Data Analysis
widely uti- lized in diverse research domains including During the Initial Exploratory Data Analysis (EDA), it
clinical medicine, epidemiology, and physiology [10] [11] was discovered that three categorical variables had missing
[12]. These datasets are openly accessible to researchers values or entries: “admission diagnosis”, “religion”, and
globally, subject to a data use agreement, providing detailed “marital status”. To address these missing values, we
yet deidentified information about a large cohort of ICU assigned “UN- KNOWN CATEGORY” to the respective
patients. The MIMIC III dataset contains comprehensive entries.
clinical data from patients treated at the Beth Israel

Fig. 1: Overview of MIMIC III clinical database.

IJISRT23NOV1911 www.ijisrt.com 2028


Volume 8, Issue 11, November 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
In line with our problem statement of predicting a one allows for clearer insights. By consolidating various
patient’s length of stay, which is initially a continuous categor- ical variables into fewer classes, we can derive
variable, we categorized it into three major groups to meaningful observations. For instance, when plotting box
facilitate analysis: plots for dif- ferent age groups and their respective lengths of
 Short Stays: 0-5 days stay (as illustrated in Fig. 2), it was observed that younger
 Medium Stays: 6-10 days individuals tend to have shorter hospital stays, while older
 Longer Stays: 10 days and above individuals are predominantly categorized under longer and
medium stays.
Converting the continuous variable into a categorical

Fig. 2: Patient length of stay (LOS) by age, across various patient ethnicity

B. Data Preprocessing as subcategories. The Table I shows the re coded


The data pre-processing comprises of the following steps: category for different categorical variables.
 Missing Value Imputation: In the dataset, there are no  Categorizing our target variable: Initially our target
null values for the continuous variables, whereas there variable was a continuous variable, but as per our
were null values for few categorical variables “admit problem statement we converted it into different segments
diagnosis”, “religion”, “marital status”. The null entries /factors (sub categories).
for the given categorical variables were replaced by  RFE technique for Feature selection: There were 28
“OTHER”, “NOT SPECIFIED”, “UNKNOWN” variables in our dataset (including the target variable).
respectively. After the data pre processing part we have 24 variables,
 Dropping the Non-Predictive Variables: We dropped 3 so to finalize the variables for our modelling part we
non predictive variables in the dataset, “patient id”, implemented the Recursive Feature Elimination
“ad- mit procedure”, “LOS group”. technique [13]. We used “treebagfuncs” that is Xgboost
 Re coding the other categorical variables into fewer [14] function, and the num- ber of folds were 10 and
categories: Categorical variables with various method was “repeated cv”. After implementing the
subcategories were reduced to fewer categories. Admit RFE technique by the above criteria we got 16
Location variable had different subcategories like “Info important features out of which 11 variables were used
not available”, “Transfer from skilled nurse, Transfer for the modelling as seen in the Fig. 3 . The 11 variables
within this facility, Transfer from Hospital”,“HMO used for modelling are age, gender, admit type, admit
Referral /SICK”. All the subcategories like “Info not diagnosis, num transfers, num notes, num diagnosis,
available” were assigned as “Unknown” while num callouts, num procedures, num drugs, LOS days.
“TRANSFER” was assigned to various transfer locations

Fig. 3: Recursive Feature Elimination technique

IJISRT23NOV1911 www.ijisrt.com 2029


Volume 8, Issue 11, November 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
 Further Exploratory Data Analysis: hospital. Whereas the people with a median age above
 Length of stay v/s Age: As per the Fig. 4 for the very 65 had the longest stay at the hospital
short stays, the median age is 50 that means persons with  Age v/s Length of Stay (For both Males and Females): As
median age of 50 years had a very short stay at the per Fig. 5, females with a median age of 50 had a very

Fig. 4: Patient length of stay (LOS) v/s Age.

Fig. 5: Age v/s Length of Stay(LOS)

short stay at the hospital. Whereas both the Males and VI. RESULTS
Females with a median age of above 65 had the longest stay
at the hospital. Initially, the target variable (LOS) had 3 classes: short
(0- 5), medium (5-10), and long (>10 days). The
C. Modelling Approach performance of all three models Logistic Regression, Random
 Approach 1: We built a classification model, to predict Forests, and Boosting, is presented below. With three
the output variable LOS(Length of Stay)/. Various target classes, all models exhibited subpar performance with
classifica- tion model, like Logistic Regression [15] [16], an accuracy below 50%. The Gradient Boosting model
Random Forest [17], and Boosting [18] were implemented slightly outperformed the other two models with an accuracy
on the unseen dataset. of 45.71%, an error rate of 54.28%, and a 95% confidence
 Approach 2: As the target variable is continuous we interval in the range of 0.4523.
can use the regression techniques as well , like multiple
linear regression. Multiple linear regression [19], uses
several explanatory variables to predict the outcome of
a response variable. Hence, the patient’s length of stay
can be modelled as a linear function of multiple
variables.

IJISRT23NOV1911 www.ijisrt.com 2030


Volume 8, Issue 11, November 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
Table 1: Recoding Categorical Variables
Variable Original Category Recoded Category
INFO NOT AVAILABLE UNKNOWN
ADMIT TRSF WITHIN FACILITY, TRANSFER TRANSFER
LOCATION FROM OTHER HMO REFERRAL/SICK
UNOBTAINABLE NORMAL
NOT SPECIFIED
RELIGION
CATHOLIC, JEWISH, PROTESTANT QUAKER, NOT SPECIFIED DELI
OTHER
ASIAN CHINESE, ASIAN-THAI, ASIAN-INDIAN, ASIAN- ASIAN
ETHNICITY VIETNAMESE, ASIAN-JAPNESE WHITE
WHITE-RUSSIAN, WHITE-OTHER, WHITE-OTHER EUROPEN HISPANIC-
PUERTO
LIFE TICAN, DOMINICAN, GAUTEMALAN,
PARTNER LATINO
MARRIED
MARITAL CUABN, MEXICAN , ETC SOUTH-AMERICAN,
UNKNOWN OTHER
UNKNO
STATUS AMERICAN INDIAN, BLACK-AFRICAN
DIVORCED,SEPER WN
ADMIT ATED
CORONARY ARTERY DISEASE\\CORONARY ARTERY BYPASS DIVORC
CORONARY ARTERY
DIAGNOSIS GRAFT / SDA ED
DISEASE
UPPER GI BLEED, LOWER GI BLEED, UPPER GASTRO GASTROINTESTINAL
INSTESTINAL BLEED BLEED

to 0.4620. The confusion matrix metrics, such as hospital length of stay for the short days class. Finally, we
precision and recall, also displayed significantly poor results, considered the target variable as continuous and applied a
with none of them surpassing the 70% threshold in any of the linear regression model for prediction. However, the outcomes
three models. To further enhance these results, we from this model, as depicted below, were notably inferior
expanded the target variable into two additional classes, compared to the classification models with 3 classes. The
resulting in a total of 5 classes. In this scenario, the Multiple R-squared value was computed to be 0.0971,
performance improved signifi- cantly for all three models. As while the adjusted R-squared was 0.09702.
seen in the table below, Random Forests outperformed the
other two models with an accuracy of 87.11%, an error rate Since the classification models outperformed the
of 18.37%, and a 95% confidence interval in the range of regression model, we opted to use classification as our final
0.8661 to 0.8760 as seen in the Fig. 6. clearly indicates that model.
our Random Forest model is successfully predicting the

VII. DISCUSSION

Fig. 6: Random Forest Model Summary.


Other performance metrics, such as precision and VIII. LIMITATION
recall, also saw significant improvements for all three models.
In the case of Random Forest, precision and recall rates Applying predictive analysis to healthcare settings is
were over 75% for all classes and even reached as high as chal- lenging due to the numerous unforeseen parameters
95-96% for the short and very short days classes. It was that can affect model results. Despite our best efforts to
observed that precision was highest for the short days leverage the data for generalizing the model and
class at 95% and lowest for the long days class at 77%. quantifying the cost of different lengths of stay, unforeseen
Even the sensitivity (recall) was high for the short and very parameters, particularly in emergency cases where admission
short-day classes. This diagnosis may not accu- rately identify patients’ underlying

IJISRT23NOV1911 www.ijisrt.com 2031


Volume 8, Issue 11, November 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
conditions pose significant challenges. Given the complex This project has provided us with valuable insights into
and sensitive nature of this domain, it’s challenging to the complexity of analytical tools used in healthcare analytic
generalize the models extensively. It’s important to note and the implications these models may have in practice. It has
that the data used for this analy- sis comprises admissions also shed light on the challenges one can face when
to Beth Israel Deaconess Medical Center in Boston, attempting to apply purely data-driven approaches in the
Massachusetts, one of the highly regarded hospitals in the medical domain. Predictive modeling holds significant
United States. Consequently, the patient data we observed potential for contributing to advancements in hospital resource
were predominantly from specific ethnic groups, primarily management, diagnostic analysis, and even early detection of
covered by private insurance or Medicare, with a median diseases and disabilities.
patient age of 59 years. Notably, a majority of the patients
were classified as emergency room admissions, and the To operationalize these academic predictive models,
mortality rate in these records was significantly higher careful consideration should be given to evaluating the pros
than the US average mortality rate for emergency room and cons they may bring in practical circumstances. The
admissions. This dataset’s patient profile indicates that this model should be designed to analyze and interpret
sample of patient records does not accurately represent the circumstances in a manner that benefits all the involved
wider demographic composition of patients across the United communities, including patients and medical staff.
States. Therefore, caution must be exercised in generalizing
the results of our analysis to the broader US population. X. FUTURE WORK
Additionally, it’s essential to consider that this dataset includes In terms of future work, we plan to collaborate with
patient records from 2001 to 2012, so recent advancements multiple doctors to incorporate their insights from initial
in hospital infrastructure, diagnostic capacity, and resource diagnoses into our model. This collaborative effort aims to
capacities may not be reflected in this data. enhance the current model’s accuracy and enable a
A significant limitation of classification models using perspective that integrates medical expertise rather than
healthcare data is the lack of comprehensive measures. In relying solely on a data-based approach.
prioritizing feature validity over model accuracy, we ended REFERENCES
up with a total of 11 variables, of which nine are categori-
cal (admit type, admit diagnosis, num transfers, num notes, [1]. P. E. Petersen and H. Ogawa, “The global burden of
num callouts, num procedures, num drugs, LOS day), one is periodontal dis- ease: towards integration with chronic
binary (gender male), and one is continuous (age). While the disease prevention and control,” Periodontology 2000,
MIMIC III database [6] offers more detailed information on vol. 60, no. 1, pp. 15–39, 2012.
patient-caretaker interactions, we chose to utilize only the av- [2]. B. Friedman, H. J. Jiang, A. Elixhauser, and A. Segal,
erage quantity of these measures rather than the results of tests, “Hospital inpatient costs for adults with multiple chronic
procedures, and patient notes. To enhance the performance of conditions,” Medical Care Research and Review, vol. 63,
classification models, we can incorporate additional critical no. 3, pp. 327–346, 2006.
metrics such as pulse rate, heart rate, oximeter readings, [3]. H. Catalyst, “Interview with stanford cio, carolyn byerly:
temperature, nerve and pain reflexes, as well as other general Launching a clinical data warehouse in months,” Health
indicators like pre-existing medical conditions at the time of Catalyst, 2016.
admission. [4]. M. Hassan, H. P. Tuckman, R. H. Patrick, D. S. Kountz,
and J. L. Kohn, “Hospital length of stay and probability
IX. CONCLUSION of acquiring infection,” International Journal of
The primary aim of this project is to comprehend the pharmaceutical and healthcare marketing, vol. 4, no. 4,
diverse range of patient data available and generate a model pp. 324–338, 2010.
to understand and visualize the underlying patterns. We intend [5]. T. Panch, P. Szolovits, and R. Atun, “Artificial
to utilize these models to predict a patient’s hospital length of intelligence, machine learning and health systems,”
stay, thereby reducing the burden of monotonous hospitaliza- Journal of global health, vol. 8, no. 2, 2018.
tion efforts. Leveraging retrospective data from the MIMIC [6]. A. E. Johnson, T. J. Pollard, L. Shen, L.-w. H. Lehman,
III dataset [6], we successfully developed classifications to M. Feng, M. Ghassemi, B. Moody, P. Szolovits, L.
comprehend potential underlying factors that can influence a Anthony Celi, and R. G. Mark, “Mimic-iii, a freely
patient’s length of stay. After comparing the performance of accessible critical care database,” Scientific data, vol. 3,
different predictive classification models, we concluded that no. 1, pp. 1–9, 2016.
given the current limitations of the dataset, the present models [7]. A. S. Fauci, H. C. Lane, and R. R. Redfield, “Covid-
can effectively predict a patient’s length of stay within the 19—navigating the uncharted,” 2020.
short length range. [8]. T. P. Velavan and C. G. Meyer, “The covid-19
epidemic,” Tropical medicine & international health, vol.
25, no. 3, p. 278, 2020.

IJISRT23NOV1911 www.ijisrt.com 2032


Volume 8, Issue 11, November 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
[9]. L. Yang, S. Liu, J. Liu, Z. Zhang, X. Wan, B. Huang, Y.
Chen, and Y. Zhang, “Covid-19: immunopathogenesis
and immune therapeutics,”
[10]. Signal transduction and targeted therapy, vol. 5, no. 1,
pp. 1–8, 2020. [10] Z. Zhang, D. Yang, and Y. Zhang,
“Disease diagnosis based on multi- view contrastive
learning for electronic medical records.,” IAENG Inter-
national Journal of Applied Mathematics, vol. 53, no. 3,
2023.
[11]. R. Long, D. Yang, and Y. Liu, “Diseasenet: A novel
disease diagnosis deep framework via fusing medical
record summarization,” IAENG International Journal of
Computer Science, vol. 49, no. 3, 2022.
[12]. Z. Lin, D. Yang, H. Jiang, and H. Yin, “Learning patient
similarity via heterogeneous medical knowledge graph
embedding,” IAENG Interna- tional Journal of Computer
Science, vol. 48, no. 4, 2021.
[13]. X.-w. Chen and J. C. Jeong, “Enhanced recursive feature
elimination,” in Sixth International Conference on
Machine Learning and Applications (ICMLA 2007), pp.
429–435, IEEE, 2007.
[14]. T. Chen, T. He, M. Benesty, V. Khotilovich, Y. Tang, H.
Cho, K. Chen, et al., “Xgboost: extreme gradient
boosting,” R package version 0.4-2, vol. 1, no. 4, pp. 1–
4, 2015.
[15]. R. E. Wright, “Logistic regression.,” 1995.
[16]. D. Bo¨hning, “Multinomial logistic regression
algorithm,” Annals of the institute of Statistical
Mathematics, vol. 44, no. 1, pp. 197–200, 1992.
[17]. V. Svetnik, A. Liaw, C. Tong, J. C. Culberson, R. P.
Sheridan, and B. P. Feuston, “Random forest: a
classification and regression tool for compound
classification and qsar modeling,” Journal of chemical
information and computer sciences, vol. 43, no. 6, pp.
1947–1958, 2003.
[18]. J. H. Friedman, “Greedy function approximation: a
gradient boosting machine,” Annals of statistics, pp.
1189–1232, 2001.
[19]. P. Burton, L. Gurrin, and P. Sly, “Extending the simple
linear regression model to account for correlated
responses: an introduction to generalized estimating
equations and multi-level mixed modelling,” Statistics in
medicine, vol. 17, no. 11, pp. 1261–1291, 1998.

IJISRT23NOV1911 www.ijisrt.com 2033

You might also like