{'fraction_non_alphanumeric': 0.039361141513640605, 'fraction_numerical': 0.023795046414528356, 'mean_word_length': 5.340272423541506, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Comparison of Two Statistical Models for Predicting Mortality in COVID-19 Patients in Iran

Background: Today, the COVID-19 pandemic is ever-increasingly challenging healthcare systems globally with many uncertainties andambiguitiesregardingdiseasebehaviorandoutcomeprediction. Thus,machinelearning(ML)algorithmscouldbepotentially demanding to tackle these challenges. Objectives: The present study aimed to construct and compare two prediction models based on statistical and computational ML algorithms to predict mortality in COVID-19 hospitalized patients and, ﬁnally, adopt the best-performing algorithm, accordingly. Methods: Having considered a single-center registry, we scrutinized 482 records of laboratory-conﬁrmed COVID-19 hospitalized patients admitted from February 9, 2020, to December 20, 2020. The most important clinical parameters for COVID-19 mortality prediction were identiﬁed using the Phi coeﬃcient technique. In the next step, two statistical and computational ML models, ie, logisticregression(LR)andartiﬁcialneuralnetwork(ANN),wereevaluatedthroughthemetricsderivedfromtheconfusionmatrix. Results: Predictive models were trained using 16 validated features. The results indicated that the best performance pertained to the ANN classiﬁer with a positive predictive value (PPV) of 0.96, a negative predictive value (NPV) of 0.86, the sensitivity of 0.94, speciﬁcity of 0.94, and accuracy of 0.93. Conclusions: According to the results, ANN predicted mortality in hospitalized patients with COVID-19 with an acceptable level of accuracy. Therefore, it would be extremely reasonable to develop intelligent decision support systems to early detect high-risk patients, helping clinicians come up with proper interventions.


Background
In December 2019, the novel coronavirus disease (COVID- 19), detected initially in Wuhan China, rapidly spread all over the world. As a result, the world health organization (WHO) declared this outbreak a pandemic in January 2020 (1,2). Unfortunately, the aggressive dissemination of this contagious viral infection resulted in major global challenges such as the shortage of hospital resources and exhaustion of healthcare providers, which necessitates developing accurate prediction models to both effectively triage patients and also maximize the use of limited resources. Besides, healthcare administrators and clinicians count on different computational and statistical models to effectively and accurately predict uncertainties in hospital and medical settings (3)(4)(5).
The clinical outcomes of the novel virus range from asymptomatic or mild symptoms to serious complications and even death in some cases. For example, in some patients with a set of mild to moderate symptoms, a severe form of the disease emerges, which requires advanced risk, stratification models. Using prediction models, professionals promptly identify patients in the early stages of the disease, which, in turn, minimizes the mortality rate (6,7). regression, Cox regression, and machine learning (ML) algorithms (8,9). To diminish pandemic-related challenges, health care providers worldwide apply ML, and statistical models to early predict COVID-19 deterioration (7,10,11). Machine learning, a branch of Artificial Intelligence (AI), facilitates extracting high-quality prediction models from the mining of huge raw datasets (12) and serves as a valuable tool in medical research to improve predictive modeling and reveal new contributing factors to a specific outcome (12,13). In addition, ML algorithms may minimize uncertainties and ambiguities by offering evidence-based medicine for risk analysis, screening, prediction, and care plans; they also support reliable clinical decision-making through health care quality improvement (14,15). In this regard, supervised classification of learning algorithms (both statistical and computational) can be utilized to address these uncertainties by providing patient risk stratification for tailored clinical decision-making support (ie, measuring the probability of a disease, assessing disease likelihood, forecasting disease spread, and predicting fatality) (8,9,(16)(17)(18).
Machine learning algorithms, which analyze the inputs and outputs of complex processes, can provide prediction models that perform better than traditional ones. Also, they can detect nonlinear connections, improve multifactor algorithms, and upgrade methodologies for model validation (19,20). Machine learning-based prediction models have successfully achieved early detection of disease trends and outbreaks, forecasting of disease behaviors and outcomes, and estimation of patient survival and patients' responses to supportive therapies during the pandemic (19,21). In this regard, with the onset of the current pandemic, researchers used ML to design and improve models for predicting poor disease outcomes and early detection of patient condition deterioration (such as ICU admission, mechanical intubation, or even death). Hence, these models greatly helped frontline therapists and decision-makers opt for the most effective supportive and therapeutic plans at the right time and place (15,22,23).

Objectives
Since different laboratory, clinical, and epidemiological features affect the survival or death of COVID-19 patients, it is important to understand these factors to reduce the mortality rate to a greater extent (24). Besides, the large volume of multidimensional data may perplex therapists in identifying the most important factors (25). Therefore, ML algorithms ease developing prediction models due to their numerous feature selection and classification capabilities (13,26). Therefore, we aimed to develop and compare two statistical and computational ML methods for predicting mortality among hospitalized patients with COVID-19.

Methods
This retrospective, single-center study aimed to develop a prediction model based on two ML algorithms for mortality risk classification in hospitalized COVID-19 patients. It was conducted in four stages as follows: 1-data understanding, 2-patient selection, 3-preprocessing and data reduction, and 4-model development and evaluation.

Data Understanding
In this retrospective study, a COVID-19 hospital-based registry database from Imam Khomeini hospital, Ilam city, west of Iran, was thoroughly reviewed. Needless to say, the study was approved by the ethical committee board of Ilam University of Medical Sciences (Ethics code: IR.MEDILAM.REC.1399.294). Plus, only the patients admitted from January 9, 2020 to January 20, 2021 with a positive RT-PCR test for COVID-19, who met our inclusion criteria, were included. Then three health information management (HIM) experts quantitatively and qualitatively investigated case records based on 54 risk factors under six main classes: patients' demographics (five variables), clinical manifestations (14 variables), comorbidities (seven variables), laboratory parameters (26 variables), treatment (one variable), and outcome (one variable). The data fields for each class have been illustrated below: Demographics: Gender, age, weight, height, and blood type.

Patient Selection
Eligible patients who matched the inclusion criteria comprised a total of 12885 cases suspected to have COVID-19, referred to Imam Khomeini hospital's ambulatory and emergency departments (EDs), of whom 3350 cases were confirmed by RT-PCR. Based on exclusion criteria, finally, 482 records entered the study (306 and 176 of whom would survive and die, respectively). The exclusion criteria were as follows: (1) non-COVID-19 or non-hospitalized cases or patients with unknown disposition, (2) patients who were 18 years old or younger, (3) incomplete case records (missing data more than 70%), and (4) admission time before January 9, 2020 or after January 20, 2021. To ensure privacy and confidentiality of information, we promised to use unique identification codes for every patient throughout data collection and data presentation.

Preprocessing and Data Reduction
First, incomplete case records with great missing data (more than 70%) were excluded from analysis. Also, the remaining missing values were imputed using the mean or mode of each variable. Noisy and abnormal values, errors, duplicates, and meaningless data were checked by two HIM experts (M. SH and L. E), two infectious disease specialists, and a hematologist. When there were different interpretations on data preprocessing, we contacted the corresponding physician. Moreover, we initially omitted some features that were not common for model construction for better and easier analysis of the database before training the prediction models. Feature selection is characterized by the process of identifying and removing unneeded or redundant variables from the original dataset without any major loss of information. In the case of highdimensional data, feature selection is deemed to be one of the key steps in data mining and pattern recognition. It enhances learning efficiency, increases prediction performance, and minimizes the complexity of model training via input optimization (27)(28)(29). To determine the most important factors for predicting mortality among hospitalized patients, the Phi correlation coefficient was used at P < 0.01 to specify a meaningful relationship between each input variable (mortality determinants) and output variable (death or survival) (30, 31).

Model Development and Evaluation
In the present study, two types of prediction models, including statistical BLR and computational ANN, were implemented.
Logistic regression: This model can be utilized to determine probable relationships between independent and dependent variables. Frequently, they can be used in twovalued output classes (ie, dichotomous variables), such as the relationship between several factors affecting Coronavirus disease (COVID-19: code 0 or non-COVID-19: code 1). A simple formula for this method has been shown in Equation 1, where "P" denotes the possibility of output occurrence; b 0 is the intercept, and b 1 is the coefficient of the input (or X in the formula), which belonged to the training dataset (32,33).
In this study, the Forward LR method of BLR was applied to develop the prediction model in IBM SPSS Statistical software, V 25. Then its performance was assessed using two quantitative criteria, including true positive (TP), false positive (FP), false negative (FN), true negative (TN), and log-likelihood (Equation 2).
The log-likelihood function is a method for determining the underlying model's goodness of fit using sample data. It can also be defined as the difference between the probabilities of the expected and observed outputs' occurrences. It is, of course, necessary to emphasize that the smaller this amount is, the better the algorithm can perform. In Equation 2, P (Y i ) is the probability of the observed output occurrence, associated with the (i) value that belongs to the Y dependent variable. Also, L(P, Y) is Loglikelihood, and 1-P(Y i ) is the probability of non-observed output occurrence.
Artificial neural networks: Artificial neural networks (ANNs) are a set of computing algorithms that emulate the functions of biological neural networks. The components of the models are nodes, weights, and layers (input, hidden, and output layers) (34,35). The three structural layers of this model are associated with predictor variables, weighted nodes connecting the input and output layers, and dependent variables, respectively (36). Moreover, activation methods are necessary to determine the link between different nodes in ANNs' functional configurations that can be simulated using different mathematical functions (37).
Multilayer perceptron-ANNs (MLP-ANNs) are the simplest and most commonly used ANN architectures thanks to their structural flexibility, good representational capabilities, and a large number of trainable algorithms (28,29). In this research, therefore, the backpropagation type of MLP-ANN configuration was applied owing to its low error rate in predicting output variables, as well as its exten- sive use in the literature (38). Also, we applied the tansing activation method to connect weighted nodes in ANNs. In this study, the ANN was designed in MATLAB software R 2013 to predict mortality among hospitalized patients with COVID-19, using 70% of data for ANN training and 15% for each of validating and testing the model developed. We first determined the number of inputs and outputs in each two input and hidden layers, which were associated with the number of independent and dependent variables, respectively. Subsequently, we placed one node in one hidden layer and then measured its performance based on different criteria, including sensitivity, specificity, and accuracy. In each step, we added a node and measured its performance. Then the best configuration of ANNs was selected by comparing different nodes and the number of the hidden layer(s). Finally, training and validating mean squared errors (MSE) and the area under the ROC curve (AUC) of ANN were determined as final key parameters of the prediction models. Hence, to compare the performance of the models in predicting mortality, we applied some criteria such as positive predictive value (PPV), negative predictive value (NPV), sensitivity, specificity, and accuracy, which were obtained from the confusion matrix and AUC-ROC curve.

Feature Selection
Based on the Phi coefficient correlation between each death determinant and the output variable (survival (0) and (death (1)), 16 variables were recognized as the most important predictors of mortality in hospitalized COVID-19 patients at P < 0.01), as shown in Table 1.

Logistic Regression
Using the Forward LR method of BLR, five steps were taken in the prediction model. Table 2 depicts the table of  the Model of IF-Removed. As it can be seen in Table 2, entering the ICU hospitalization variable into the first step resulted in a log-likelihood of -126.59, assigning this variable as the first to enter into the model. Also, by entering other important variables in next phases into the model, we demonstrated that the loglikelihood rate reduced till the final step (ie, 5th step). In this step, the log-likelihood of the loss of smell, which was entered into the model as the latest variable, was obtained -53.974. Simultaneously, other variables suggested the minimal value of log-likelihood in this step at P < 0.01 (df = 1). Figure 1 represents the predictive power of BLR in determining the probability of survival and death in hospitalized patients with COVID-19 based on the aforementioned five-step process described in the previous section.
As shown in Figure 1, vertical vertices demonstrate the number of BLR's iterations in each step for death prediction whereas horizontal vertices are possible BLR values at which the predicted cases would be categorized into certain groups. For example, a predicted probability of > 0.5 was regarded as "dead," while values less than 0.5 predicted the "survival" of hospitalized COVID-19 patients.
At the cut-off value of 0.5, the symbols of 0 and 1 represented survived, and dead cases, respectively, and each symbol equated to 10 cases of interest. Hence, we compared steps 1 and 5 of BLR and noticed that the addition of those five important variables to the BLR model caused the representative cases associated with survived hospitalized patients (0) to recede from the threshold (0.5), especially in high BLR iterations. Therefore, the difference between the probability predicted by the model and the expected rate reduced (ie, log-likelihood reduction). Also, the representative cases related to demised hospitalized patients (1) in step 5 were closer to 1 compared to their distance from the threshold in step 1 (ie, log-likelihood reduction and consequently, the model's performance augmentation). Besides, comparing the final step of BLR with step 1 based on the TP, FP, TN, and FN values revealed that truly classified cases (TP = 133 and TN = 252) in step 5th significantly increased compared to respective values in step 1st (TP = 105 and TN = 173). However, the number of falsely classified cases was lower in step 5th (FP = 55 and FN = 43) than in step 1st (FP = 134 and FN = 71), indicating a much higher efficiency in step 5th than in step 1st regarding the correct classification of survived and dead COVID-19 hospitalized patients.

Artificial Neural Network
It should be noted that the addition of sigmoid nodes to the hidden layer(s) for ANN training and subsequently,  The results of MSE measurement for ANN ( Figure 2) showed that the ANN acquired the best performance at 16th training repetition (six steps before reaching the best validation (22nd epoch)). As noted, the best validation performance was achieved in 22nd training epoch (MSE = 0.037122). In this step thus, the MSE of ANN training and testing was close to the validation performance (0.01 < MSE < 0.1) (Figure 2). The error histogram for the ANN algorithm has been depicted in Figure 2.
The error histogram with 20 bins was utilized to classify the training and validate and test various states of the ANN. As indicated in Figure 2, approximately 200 samples with the error rate of -0.00111 and more than 100 samples with the error rate of 0.0904 were used to train the ANN. Also, the error rate was set in these two amounts to validate and test the subset of the dataset. The presence of some outliers in the databases directed a few portions of training and testing data into 0.914 and -0.8247 points of the error histogram diagram, slightly decreasing the ANN's performance.

Comparison of Two Selected Methods
The results of comparing the performance of two selected methods via the confusion matrix demonstrated that the ANN correctly predicted the outcome of 92.9% of hospitalized patients; however, 79% of the patients were correctly classified in the 5th step of the BLR technique. Also, the incorrectly classified samples in ANN and BLR's 5th step included FP = 1.9% vs. 11.4% and FN = 5.2% vs. 8.9%, respectively, revealing the lower rate of incorrectly classified samples in the ANN method. The results of PPV, NPV, sensitivity, specificity, and accuracy of the ANN and BLR techniques have been presented in Figure 3.
As shown in Figure 3, the ANN had a higher prediction performance than the BLR. The AUCs of the two different methods, AUC-ROC of the ANN, and the results of the confusion matrix have been shown in Figure 4.
Based on Figure 4, the percentages of the cases correctly classified in the training, validation, and test phases were 92.3%, 95.8%, and 93.1%, respectively. The validation (with 95.8% of TP+TN) and training (with 92.3% of TP+TN) of the confusion matrix presented the best and poorest performances, respectively. Figure 4 also demonstrated that the ANN technique (AUC = 0.90) was better than the BLR technique (AUC = 0.65) in terms of prediction performance. Besides, the ROC diagram of the ANN was closer to the vertical axis (ie, the TP value). Overall, comparison of the two prediction models based on the confusion matrix, PPV, NPV, sensitivity, specificity, accuracy, and AUC revealed that the ANN model performed better in predicting death among hospitalized COVID-19 patients.

Discussion
It is believed that the early prediction of possible death due to COVID-19 based on novel, objective, and scientific techniques can help tackle the cumbersome burden of the disease on healthcare systems by effectively triaging critically ill patients and optimally managing the scarce hospital resources (15,27). Therefore, the present study's purpose was to retrospectively develop and validate two statistical and computational ML models based on the most relevant determinants of COVID-19 mortality. For this purpose, we applied two ML models (statistical: BLR and computational: ANN) to predict mortality among hospitalized confirmed COVID-19 patients based on the clinical data available in the registry database of Ilam University of Medical Sciences. The most important mortality predictors were   (40). Also, Yadaw et al. assessed the performance of four ML algorithms, including LR, RF, SVM, and eXtreme Gradient Boosting (XGBoost), using a dataset of 3841 patients to predict COVID-19 mortality. In the above-mentioned model, XGBoost with an AUC of 91% and LR with AUC of 78% gained the best and worst performance among other models developed (24). Gao (2020) conducted a retrospective analysis on the data of 2520 COVID-19 hospitalized patients. The results showed that the ANN model yielded the best performance with an AUC-ROC of 0.9760 in predicting COVID-19 patients' physiological deterioration and death compared with other models developed by LR, support vector machine (SVM), and gradient boosted decision tree (15 It should be noted that the features selected are regarded as inputs for developing ML-based models for predicting mortality among COVID-19 patients. Apparently, the strongest predictive variables include age (7,19,24,40,(42)(43)(44)(45), ICU hospitalization (15,27,40,42), low oxygen saturation (decreased SPO 2 ) (6,7,10,19,22,27,45), dyspnea (7,10,40,43), loss of taste/smell, hypertension (19,24,27,40,44,45), cardiovascular diseases (24,27,40,42,44,46), raised ALT and/or AST (22,24,40,46,47), elevated LDH (21,22,40,43), and raised leukocyte/neutrophil count (15,22,24,40,42,44,48). In the present study, the most important variables (COVID-19 mortality predictors) were identified based on correlation coefficients at the level of P < 0.01 (ie, feature selection). These variables included ICU hospitalization, activated partial thromboplastin time, length of hospitalization, pleural fluid, and absolute lymphocyte count. In general, these variables were relatively in line with the results of previous studies that have categorized and prioritized these parameters. Interestingly, the selected computational ML algorithm (ie, the ANN model) could predict mortality in COVID-19 patients with acceptable performance, which, in turn, can help optimally use limited hospital resources for treating patients with more critical conditions and assist professionals to provide more qualitative care, reducing medical errors accordingly. The models proposed in this study may facilitate the early detection and effective management of COVID-19 patients, minimizing the death rate in them. Also, developing a valid anticipative model may enhance the quality of care and increase the survival rate of COVID-19 patients. Therefore, mortality prediction and risk analysis models can greatly contribute to identifying high-risk patients, followed by the adoption of the most effective and reliable support and treatment plans. Besides, quantitative, objective and evidence-based models for risk stratification, mortality prediction, and care plan development would efficiently obviate uncertainties and ambiguities. These models also offer a better strategy for clinicians to lessen disease complications and improve patient survival likelihoods.
Despite timely and accurate identification of high-risk cases, the present study faced some limitations that may have caused classification bias as follows. First, we dealt with a retrospective dataset that might lack any unfilled and imbalanced data fields. Second, this study was conducted at a single center and on merely 482 data, so the generalizability of the proposed model is subjected to certain limitations. Third, we used only two ML algorithms for clinical-based prediction analyses, and last but not least, the selected dataset lacked some important clinical vari-ables such as radiological parameters. To sum up, the performance of our model will be enhanced if more classification techniques are tested using larger, multicenter, and prospective datasets in the future.

Conclusions
In this study, we developed and evaluated two MLbased prediction models for in-hospital mortality in COVID-19 patients using the most important clinical characteristics (16 predictors). It was observed that the ANN model performed best in terms of classification accuracy compared to the BLR algorithm. The proposed model can be suitably used to anticipate the mortality risk of hospitalized COVID-19 patients, allowing for the optimal allocation of restricted hospital resources. Also, this model could automatically identify high-risk patients as soon as they are admitted and hospitalized. To conclude, the ML algorithms coupled with qualitative and comprehensive hospital databases can be beneficial in the timely and accurate mortality risk stratification of COVID-19 patients.