## 2 Materials and Methods  
_Prediction of Postoperative FEV1 by Multilayer Regression Meta-Model_  
Let us denote with \(X\), the vector of preoperative characteristics measured for each patient individually, and by \(y\), the poFEV1 on the given day after pulmonary resection. At our disposal is a training set \((X_{i},y_{i})\), \(i=1,2,\ldots,N\) obtained by monitoring the past \(N\) patients who underwent this surgical operation. Then, within the framework of the machine learning methodology, the synthesis of a predictor  
\[\hat{y}_{i}=F(X_{i};\theta), \tag{1}\]  
is performed by minimizing the selected criterion function  
\[J(\theta)=\sum_{i=1}^{N}d(y_{i},\hat{y}_{i}), \tag{2}\]  
in the parameter space \(\theta\) of the model \(F\), where \(d\) is a suitably chosen distance measure between the actual and predicted values. Since FEV1 is a continuous variable, model (1) is of a regression type. The most commonly used distance measures \(d\) are:  
\[d_{AE}(y_{i},\hat{y}_{i})=|y_{i}-\hat{y}_{i}|, \tag{3}\]  
which gives the Mean Absolute Error (MAE) criterion \(J_{MAE}\),  
\[d_{PE}(y_{i},\hat{y}_{i})=\left|\frac{y_{i}-\hat{y}_{i}}{y_{i}}\right|\cdot 1 00\ [\%], \tag{4}\]  
giving the Mean Absolute Percentage Error (MAPE) criterion \(J_{MAPE}\),  
\[d_{SQ}(y_{i},\hat{y}_{i})=(y_{i}-\hat{y}_{i})^{2}, \tag{5}\]which gives the Mean Square Error (MSE) criterion \(\;J_{MSE}\). In this paper, we will examine the effectiveness of model \(F\) when it belongs to the stacked regressor class, [13; 14]. Stacked regression, also known as stacked ensemble regression, is a powerful technique that combines the predictions of multiple base regression models to produce a more accurate and robust final prediction. It offers several advantages over using just a single base regression model:  
1. _Improved Predictive Performance:_ Stacked regression leverages the strengths of different base regression models by blending their predictions together. As a result, it can capture complex patterns and relationships in the data that individual models might miss, yielding a performance better than any single base regression models [12]. 2. _Reduced Overfitting:_ Base regression models may suffer from overfitting if they are too complex or trained on limited data. Stacking helps reduce overfitting by blending the predictions from multiple models, effectively smoothing out any model-specific noise and generalizing better to unseen data. 3. _Model Diversity:_ To benefit from stacked regression, it is important to use diverse base regression models. Diversity can be achieved by training different models with varying algorithms, hyperparameters, or feature subsets. When combined, these diverse models contribute complementary information, leading to a more robust and reliable ensemble. 4. _Handling Nonlinearity:_ Stacked regression is particularly effective at handling non-linearity in the data. The individual base regression models might be limited in their ability to capture nonlinear relationships, but by combining them, the stacked ensemble can approximate more complex patterns. 5. _Adaptability:_ Stacked regression can be applied to a wide range of regression problems, including those with high-dimensional data, outliers, and complex interactions among features. It can be adapted to different types of regression algorithms, such as linear regression, decision trees, support vector regression, or neural networks. 6. _Handling Model Biases:_ Different base regression models may have their biases and limitations. Stacked regression can mitigate these biases by considering a variety of perspectives, leading to a more well-rounded and reliable final prediction. A typical stacked regression architecture involves using multiple layers of regression models to make predictions. The two main components in this architecture are the base regressions and the meta-model, see Figure 1. The first layer comprises base regression models. The second layer consists of the meta-model.