# Machine-Learning-Based COVID-19 and Dyspnoea Prediction Systems for the Emergency Department
## 2 Materials and Methods
### Machine Learning Models  
We chose random forest (RF) and support vector machines (SVMs) [38] to advance the state-of-the-art results [23; 24; 25]. The exploration process we reported in the previous sections encouraged this choice. Random forest is an ensemble learning methodology to classify by designing a cluster of decision trees throughout the training. The hyperparameters describing an RF algorithm are the number of estimators composing the forest, the tree's maximum depth, the highest number of levels we let each tree reach, and the estimator's minimum number of data points placed in a node before splitting it. Moreover, we usually tune the maximum number of features to be considered for splitting a node and the minimum number of data points allowed in a leaf. Finally, we also choose whether to bootstrap our data; namely, we can choose to either resample data points or not. Data scientists usually recommend exploiting bootstrap when the dataset size is small. In Table 2, we present such parameters as we find them in the Python Scikit-Learn library [39], respectively: n_estimators, max-depth, min_samples_split, max_features, min_samples_leaf and bootstrap. SVM is also a supervised learning methodology, representing one of the most robust prediction algorithms. An SVM acts by representing the data points in a p-dimensional feature space and dividing them such that there exists a hyperplane clustering the points. The gap between the hyperplane and the data points belonging to each class must be the widest. There are fewer hyperparameters compared to the RF algorithm. First, we need to determine the kernel function, the nonlinear function enabling us to fit the maximum-margin hyperplane, mapping the data points in the p-dimensional space. Data points cannot be linearly separable. Therefore, we transform them through a kernel function acting as a degree of closeness measure, mapping the data into another feature space. One of the most used functions is the radial basis function (RBF), featuring the hyperparameter \(\gamma\). The hyperparameter \(\gamma\) controls the distance of influence of each training point. The lower its value, the higher the similarity radius, resulting in more points grouped. Similarly, it exists also for other kernels. Moreover, we choose the C hyperparameter, a penalty we assign for each misclassified data point. The smaller C is, the lower the error penalty. Typically, we look for \(\gamma\subset[1\times 10^{-4},10]\) and for C \(\subset[1\times 10^{-1},100]\). Both models exploit hyperparameters to classify the data--Table 2. We adopt hyperparameter tuning procedures to boost our classification performance, evaluated in terms of ROC-AUC, accuracy, precision, recall and F1-score. The first one is called grid search cross validation. We list the values of the hyperparameters which we would like to test our models with, and we evaluate every combination. At the end of the process, we choose the values attaining the best classification performance on the K-fold cross-validation. The second one is called random search cross-validation. The process is like grid search. However, we choose the hyperparameters utilizing a heuristic search over random values. We present the best-identified hyperparameters chosen after either of these methodologies in Table 2. The hyperparameter tuning processes rely upon pseudo-random number generation, such \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**Hyperparameter**} & \multicolumn{2}{c}{**COVID-19**} \\  & & **Prediction** & **Dyspnea Prediction** \\ \hline \multirow{8}{*}{RF} & n\_estimators & 550 & 500 \\  & max\_depth & 2 & 2 \\  & min\_samples\_split & 1 & 1 \\  & max\_features & 50 & None \\  & min\_samples\_leaf & Auto & Auto \\  & bootstrap & True & True \\ \hline \multirow{4}{*}{SVM} & C & 1 & 1 \\  & \(\gamma\) & 0.01 & 0.01 \\ \cline{1-1}  & kernel & RBF & Sigmoid \\ \hline \hline \end{tabular}
\end{table} 
Table 2: RF and SVM hyperparameters for each classification task.