# Ensemble Modelling for Predicting Fish Mortality +
## 4 Materials and Methods  
As illustrated in Figure 2a, for each infectious disease under consideration \(\mathbf{D}\), a trained ensemble model takes as input a dataset of the last \(\mathbf{N}\) days of a particular fish cage (i.e., data for the present day \(t_{0}\), data for the day before today \(t_{-1}\), data for the day before yesterday \(t_{-2}\), and so forth) and produces as an output a real number that represents the estimate for the fish deaths due to the disease \(\mathbf{D}\), on the \(j\)-th forthcoming day \(t_{+j}\). The input data corresponding to a particular day \(i\) concern the real-world available data discussed in Section 3; hence, the input data of day \(i\) include the fish deaths due to \(\mathbf{D}\) on the day \(i\), the water temperature on day \(i\), the amount of food given on day \(i\), the administered medicated food of day \(i\), and the antibiotics and vaccination doses administered on the day \(i\). By combining the output of each trained ensemble model (which pertains to a specific disease), an estimate for the fish deaths of the \(j\)-th forthcoming day, due to all considered infectious diseases, is produced. For our case study, it is assumed that each ensemble model receives as input the data of a fish cage for the last 10 days (thus, \(\mathbf{N}=10\)) and produces as an output an estimate for the 3 rd forthcoming day (thus, \(j=3\)). These specific numbers were chosen in consultation with the experts of the fish-farming units. The ensemble models are constructed in two stages. The first, or intermediate, stage incorporates both an ANN and an SR model. The second, or final, stage not only includes the ANN and SR models, but also adds a DT model. The architecture diagram of each one of these two stages is illustrated in Figure 2. As shown in Figure 2b, an intermediate stage ensemble model integrates an ANN and an SR model to estimate the number of fish deaths; on the other hand, as suggested in Figure 2c, a final stage ensemble model also incorporates a DT model to further support the estimation. In any case, the synthesis of the results of the ANN, SR, and DT models is implemented by means of a weighted voting regressor, which combines the distinct ML models and computes a weighted average of their predictions. The selection of weights for the weighted voting regressor--specifically, 0.5, 0.3, and 0.2 for the ANN, SR, and DT models, respectively--has been determined through a series of trials, systematically evaluating various combinations to optimize  
Figure 1: Time-series of the daily fish deaths due to the examined diseases, as well as of the daily total fish deaths (due to all causes), during the recent period of almost five years. the balance between the models based on their individual performance and consistency. This trial-based approach ensures that each model's contribution to the final prediction is proportional to its predictive accuracy and reliability, leading to more robust and precise ensemble outcomes. It is noteworthy that the above approach to estimating fish deaths can also be applied as a binary classification approach, which does not capture the absolute number of estimated fish deaths but only whether fish deaths are expected or not. This can be carried out as follows. If the output of a trained ensemble model, deployed for a disease \(\mathbf{D}\), is a positive real number (or a positive real number greater than a certain pre-specified threshold), then we assume that fish deaths, due to \(\mathbf{D}\), are indeed expected on the \(j\)-th forthcoming day. If the output of that ensemble model is zero (or a number close to zero), then we assume that no fish deaths, due to \(\mathbf{D}\), are expected on the \(j\)-th forthcoming day. In the context of this binary classification method, the generated output will now be a collection of binary numbers (0 and 1), rather than a collection of real numbers.