Objective: To develop a predictive model of the total length of the small intestine to be applied in bariatric surgery, allowing for the individualization of surgery for each patient.
Methods: Two Excel tables were generated from a Filemaker file. Python was used through a Notebook format in Google Collaborator. The methodology included data transformation and scaling (MinMaxScaler), clustering (unsupervised machine learning with KMeans), data interpolation (oversampling machine learning technique SMOTE), modeling (PyCaret model - XGBoost), and validation.
Results: The study sample included 1090 cases. Three clusters were obtained to categorize the dataset: low, medium, and high length. The algorithm detected patients in cluster c0 with 62% accuracy and 74% sensitivity, in cluster c1 with 63% accuracy and 50% sensitivity, and in cluster c2 with 86% accuracy and 87% sensitivity. Validation was conducted with a new sample of 54 cases, showing results of 50% accuracy and 42% sensitivity for cluster c0, 58% accuracy and 61% sensitivity for cluster c1, and 30% accuracy and 43% sensitivity for cluster c2.
Conclusions: The development of a predictive algorithm for estimating the total length of the small intestine using clustering and machine learning techniques, along with XGBoost classification, is feasible, applicable, and potentially improvable with more data, both in terms of patient numbers and variables to consider.
Keywords: Cirugía bariátrica; Clustering; Inteligencia artificial; Machine learning; Modelo predictivo; artificial intelligence; bariatric surgery; clustering; machine learning; predictive model.
Copyright © 2025. Published by Elsevier España, S.L.U.