# A Machine Learning Approach to Identifying Risk Factors for Long COVID-19
## 3 Results
### Model Results  
Table 2 shows the data split for the random forest classification model into training (n = 327), validation (n = 82) and test (n = 102) subsets, with a total of 94 trees with five features per split. The accuracy of the validation subset was 0.780 and 0.892 in the test subset. The OOB accuracy was 0.962. The confusion matrix, shown below in Table 3, indicates the model correctly predicted 74 Long COVID-19 cases, with 9 misclassifications of Long COVID-19 cases as No Long COVID-19. Conversely, it correctly predicted 17 negative cases with 2 misclassifications. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Predictor Variable** & **Long COVID-19** & **Valid (N)** & **Missing** & **Mean** & **Standard** & **Relative Frequency (\%) or** \\  & & **COVID-19** & & & & **Deviation** & **Minimum, Maximum** \\ \hline \multirow{2}{*}{Age} & No & 161 & 0 & 48.199 & 14.011 & 17.000, 77.000 \\ \cline{2-7}  & Yes & 440 & 0 & 49.927 & 14.094 & 18.000, 83.000 \\ \hline \multirow{2}{*}{Timing of acute COVID-19 infection} & No & 161 & 0 & 6.534 & 2.973 & 0.000, 9.000 \\ \cline{2-7}  & Yes & 440 & 0 & 4.707 & 3.217 & 0.000, 9.000 \\ \hline \multirow{2}{*}{Other/uncommon chronic condition} & No & 161 & 0 & - & - & No = 81.988 \\  & & & & & & Yes = 18.012 \\ \cline{2-7}  & Yes & 440 & 0 & - & - & No = 93.636 \\ \hline \multirow{2}{*}{Feels lonely often} & No & 161 & 0 & - & - & Never = 54.658 \\  & 1.000 = Never & & & & & Sometimes = 32.298 \\  & 2.000 = Sometimes & & & & & Often = 13.043 \\ \cline{2-7}  & Yes & 437 & 3 & - & - & Never = 68.421 \\  & & & & & & Sometimes = 27.689 \\ \hline \multirow{2}{*}{Number of hours worked per week} & No & 161 & 0 & 21.938 & 19.009 & 0.000, 60.000 \\ \cline{2-7}  & Yes & 438 & 2 & 23.566 & 19.408 & 0.000, 78.000 \\ \hline \multirow{2}{*}{Financial security in next 3 months} & No & 155 & 6 & 11.258 & 23.452 & 0.000, 100.000 \\ \cline{2-7}  & Yes & 420 & 20 & 7.481 & 18.860 & 0.000, 100.000 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Descriptive statistics for the most significant predictors in the model. \begin{table}
\begin{tabular}{l c} \hline \hline Trees & 94 \\ \hline Features per split & 5 \\ \hline n (train) & 327 \\ \hline n (validation) & 82 \\ \hline n (test) & 102 \\ \hline Validation accuracy & 0.780 \\ \hline Test accuracy & 0.892 \\ \hline OOB accuracy & 0.962 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Data split of the random forest classification model. Using these values, the calculated sensitivity of the model is excellent at 97.4%, with a low specificity of 65.4%. These values are also displayed in Table 4 below. The evaluation metrics table (Table 4) demonstrates the overall performance of the model. The model was optimised for recall, ultimately achieving a value of 0.974. Precision and accuracy were both 0.892, the F1 score was 0.931 and the Matthews correlation coefficient for the model was 0.702. Figure 1 shows the receiver operating characteristic (ROC) plot for the model. In addition, the area under the ROC curve from Table 4 above is 0.791. Table 5 identifies the predictor variables from most to least important in the classification model, displaying the total increase in node purity and mean decrease in accuracy for each predictor. The total increase in node purity for each predictor is also illustrated in Figure 2 below. Timing of acute COVID-19 infection had the greatest total increase in \begin{table}
\begin{tabular}{l c c} \hline \hline \multicolumn{2}{c}{} & \multicolumn{2}{c}{Observed} \\ \cline{2-3}  & \multicolumn{1}{c}{Long COVID-19} & \multicolumn{1}{c}{No Long COVID-19} \\ \hline \multirow{2}{*}{Predicted} & Long COVID-19 & 74 & 9 \\ \cline{2-3}  & No Long COVID-19 & 2 & 17 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Confusion matrix. Figure 1: ROC curve.