# Machine Learning for Evaluating Hospital Mobility: An Italian Case Study
## 3 Materials and Methods  
In our study, we used data from 2021. Our selection focused on a carefully curated set of key variables presented in aggregated form. This set includes the total number of available beds and departments, healthcare personnel (nurses, doctors, and other professionals), as well as crucial data on mortality rates, readmissions, and surgical procedures. We also introduced categorical variables to distinguish between hospital networks (public vs. private) and to classify the level of healthcare facilities. These variables serve as fundamental features in our predictive model, which aims to forecast the active kilometer mobility of patients. Our analytical journey was structured into four key phases to ensure the derivation of accurate and insightful results, depicted in Figure 1:  
1. Data preprocessing: This initial phase was dedicated to improving data quality and uniformity. We carefully addressed missing values, eliminated outliers, and standardized variables, preparing the ground for a consistent and homogenized dataset. The significance of this step is echoed in a study that emphasizes the critical role of data preprocessing in healthcare analytics, highlighting how such practices can significantly enhance the accuracy of predictive models [21]. 2. Cluster analysis: In the subsequent phase, we used the k-means algorithm for a nuanced categorization of the target variable, setting the stage for more detailed insights into patient mobility patterns. This approach is supported by research that demonstrates the utility of k-means clustering in healthcare for identifying patterns and improving patient care management, further validating the choice of this method for our analysis [22]. 3. Predictive modeling: Phase 3 will see the development of an advanced predictive model, powered by logistic regression algorithms. This model will focus on the mobility variable categorized after cluster analysis, using the initially selected health variables as features. The importance of logistic regression in healthcare predictive modeling is highlighted in a review that discusses the role of predictive modeling in healthcare research, underscoring how effectively researchers can make decisions based on predictive modeling [23]. Through the application of the SHAP algorithm, we will identify the impact scores of healthcare features on the predictive model. We will use these scores as lambda weights in the subsequent data envelopment analysis. 4. Data envelopment analysis: In the final phase, we will apply the data envelopment analysis (DEA) oriented towards outputs under the assumption of variable returns to scale (VRS), to evaluate the efficiency of the 127 healthcare facilities in the Apulia-Emilia-Romagna macroregion. The model employs 8 inputs, which are the healthcare features assessed and weighted according to their impact on the predictive model, thus influencing patient choice, and a single output, healthcare mobility, with the objective of maximizing this output while keeping the inputs constant. This methodology allows for the comparison of the relative performance of hospitals against an \"efficiency frontier\". DEA analysis is extremely relevant in the healthcare context for quantifying how effectively resources are transformed into healthcare outputs, providing a comprehensive assessment of the productivity and efficiency of the healthcare facilities. The entire workflow is encapsulated in Figure 1, offering a visual map of our methodological approach. Our analyses were powered by Orange Data Mining v3.36, running on an advanced Apple M1 Pro system with 16 GB of RAM and 1 TB of storage, under macOS Sonoma 14.2.1. This high-level setup, combined with sophisticated machine learning techniques, ensured the efficiency and reproducibility of our analyses.