# Approaches for Dealing with Seasonality in Clinical Prediction Models for Infections
## 3 Materials and Methods
### Dataset Description
#### 3.5.1 Synthetic Datasets  
We created two synthetic datasets in order to simulate two different seasonal variations. Let us assume the model defined by the equation \(k_{1}x_{1}+k_{2}x_{2}=y\), where \(x_{1}\) and \(x_{2}\) are random variables within the range \([-10,10]\). The values of \(k_{1}\) and \(k_{2}\) represent the unknown factors of the model that need to be estimated. Because our focus is on binary classification models, we introduce a categorical column named _class_ as the binary outcome. This column takes two possible values: _non-negative_ when \(y\geq 0\), and _negative_ otherwise. Figure 2: Examples of our proposed adaptation of the ensemble algorithm for seasonality: (**a**) shows the steps for training the models in a monthly ensemble, while (**b**) shows the steps for estimating the class to which a new observation belongs. Our aim was to simulate a concept drift during winter. This was achieved by varying the value of \(k_{1}\) between 0 and 1 throughout the year and calculating the value of \(k_{2}\) as \(k_{2}=1-k_{1}\). If \(k_{1}=1\), then \(k_{2}=0\), and the outcome \(y\) depends only on the value of \(x_{1}\). The contrary occurs when \(k_{1}\) reaches 0. Consequently, each observation includes a _timestantump_ attribute that is used to vary the values of these factors according to the season. here, this attribute ranges from the 1 January 2100 to 31 December 2199, similar to the dates in the MIMIC-III database, although our methods consider only the month or season of each particular date. Furthermore, we added extra variables that are not directly related to the model in order to simulate the problem of high dimensionality. We included ten random variables, \(r_{1}\) to \(r_{10}\), that have a uniform distribution with values in \([-10,10]\). In addition, we included another ten variables \(c_{j}^{1},j\in\{1,\ldots,10\}\) correlated with \(x_{1}\) and ten more variables \(c_{j}^{2},j\in\{1,\ldots,10\}\) correlated with \(x_{2}\). These variables were calculated as follows:  
\[c_{j}^{i}=x_{i}+\epsilon,\epsilon\sim U(-2,2). \tag{3}\]  
As such, these \(c_{j}^{i}\) variables have values similar to those that really affect the outcome of the model, with an additional small random error such that they are not perfectly correlated. The synthetic datasets eventually contain a total of 33 columns: one nominal column that indicates the class of the observation (_non-negative_ or _negative_), two columns (\(x_{1}\) and \(x_{2}\)) that really affect the class, ten absolutely random columns (\(r_{1},\ldots,r_{10}\)), and twenty columns (\(c_{1}^{1},\ldots,c_{10}^{1},c_{1}^{2},\ldots,c_{10}^{2}\)) correlated with \(x_{1}\) or \(x_{2}\). A class imbalance of ten to one was then simulated in order to increase the complexity of the dataset. After each dataset had been generated, we assumed that the _non-negative_ class was the minority one and randomly removed samples until there were ten _negative_ samples for each _non-negative_ sample. A total of 5500 rows were generated per dataset (5000 _negative_ samples and 500 _non-negative_ samples). We made two different assumptions about how seasonality affects data, which were simulated by varying \(k_{1}\) and \(k_{2}\) over time:  
* In the _condensed dataset_, we assumed that \(x_{1}\) does not affect \(y\) (i.e., \(k_{1}=0\) and \(k_{2}=1\)) except in winter, when \(y\) becomes gradually affected by \(x_{1}\) following a Gaussian curve with its maximum centered in the middle of the season (i.e., \(k_{1}=1\) and \(k_{2}=0\) exactly in the middle of winter). In this case, the effects of seasonality are strictly present only during winter. * In the _sinusoidal dataset_, we assumed that \(k_{1}\) varies following a sinusoidal function that reaches it maximum in the middle of winter and that its effects decrease slightly until reaching its minimum in the middle of summer. The use of sine curves to represent seasonal variation is quite common in epidemiological studies regarding the seasonal occurrence of infectious diseases [8].