Your new experience awaits. Try the new design now and help us make it even better

ORIGINAL RESEARCH article

Front. Med. Technol.

Sec. Medtech Data Analytics

Explainable Machine Learning for Predicting Postoperative Length of Stay After Gastrectomy: A Nationwide Study Using XGBoost and SHAP

Provisionally accepted
Tsunehiko  MaruyamaTsunehiko Maruyama1*Kazuto  IkezawaKazuto Ikezawa2Hideo  SuzukiHideo Suzuki3Tomohiro  KurokawaTomohiro Kurokawa4Yoshimasa  AkashiYoshimasa Akashi3Tatsuya  OdaTatsuya Oda3
  • 1Mito Saiseikai General Hospital, Ibaraki, Japan
  • 2Tsukuba Kinen Byoin, Tsukuba, Japan
  • 3Tsukuba Daigaku, Tsukuba, Japan
  • 4Fukushima Kenritsu Ika Daigaku, Fukushima, Japan

The final, formatted version of the article will be published soon.

Background: Gastric cancer remains a major cause of cancer-related morbidity and mortality. Despite advances in surgical and perioperative care, prolonged hospitalization continues to strain healthcare systems. Predicting postoperative length of stay (LOS) could support personalized care and efficient resource allocation. Japan's nationwide Diagnosis Procedure Combination (DPC) database provides real-world data for large-scale analysis, but no study has applied machine learning to predict LOS after gastrectomy. Methods: This retrospective study included 26,097 patients who underwent gastrectomy between 2017 and 2022 at 472 hospitals in Japan. Using XGBoost, we developed a predictive model based on 1,433 admission-time variables extracted from the DPC database. Model performance was evaluated using Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE) in a five-fold cross-validation. SHAP values were used to interpret feature importance. Results: The final model achieved an RMSE of 3.74 and MAE of 2.82 days. Key predictors of LOS included surgical procedure (laparoscopic distal gastrectomy and open total gastrectomy), designated cancer hospital, hospital size, peritoneal dissemination, and admission ADL score. SHAP analysis revealed that Laparoscopic distal gastrectomy and higher hospital volume were associated with shorter LOS, while open total gastrectomy was associated with longer LOS. Conclusions: We developed a machine learning model that predicts postoperative length of stay with an error range of 2 to 4 days using admission data. This proof-of-concept study demonstrates the feasibility of predicting length of stay from admission data, showing that explainable AI can replicate intuitive patterns in surgical oncology while simultaneously identifying unexpected insights from administrative data. These findings highlight the clinical potential of explainable AI for perioperative workflow optimization.

Keywords: artificial intelligence, DPC data, gastric cancer, Explainable AI, Length of Stay

Received: 28 Oct 2025; Accepted: 20 Nov 2025.

Copyright: © 2025 Maruyama, Ikezawa, Suzuki, Kurokawa, Akashi and Oda. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

* Correspondence: Tsunehiko Maruyama, t-maru@ya2.so-net.ne.jp

Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.