Introduction

Severe Acute Respiratory Syndrome Coronavirus two (SARS-CoV-2), the causative agent of novel coronavirus (COVID-19 or 2019-nCoV), has emerged in late 2019 which is believed to be originated from Hubei Province, China called Wuhan [16, 25]. 2019-nCoV or COVID-19 is rapidly spreading in humans which is evidently believed that it was first derived from bats, transmitted to humans through intermediate hosts probably the raccoon dog (Nyctereutes procyonoides) and palm civet (Paguma larvata) [8, 18, 21]. The major symptoms of SARS-CoV-2 include fever, cough, and shortness of breath which in many instances appeared to be similar to that flu [16]. COVID-19 had since reached a decisive point and pandemic potential which claimed the lives of many people across the world and human-to-human transmission of COVID-19 from infected individuals with mild symptoms have been reported [16, 20]. According to Worldometers, COVID-19 pandemic affects 210 countries and territories around the world and 2 (02) international conveyances with 6,033,875 confirmed cases, 2,661,213 recovered cases, and 366,894 deaths as of May 30th, 2020, 05:37 GMT [27]. However, there is no drug or vaccine clinically proven to treat COVID-19 pandemic, therefore other non-clinical or non-medical therapeutic techniques are urgently needed to contain and prevent further outbreak of COVID-19 pandemic such as data mining techniques, machine learning and expert system among other artificial intelligence techniques.

Data mining (DM) is an advanced artificial intelligence (AI) technique that is used for discovering novel, useful, and valid hidden patterns or knowledge from dataset [6, 14]. The technique reveals relationships and knowledge or patterns among the dataset in several or single datasets [15, 16]. It has also widely used for the prognosis and diagnosis of many diseases including Severe Acute Respiratory Syndrome Coronavirus (SARS-CoV) and Middle East Respiratory Syndrome Coronavirus (MERS-CoV) that were so far discovered in 2003 and 2012, respectively [16]. As huge dataset generated around the world related to 2019-nCoV pandemic everyday is a treasured resource to be mined and analyzed for useful, valid, and novel knowledge or patterns extraction for better decision-making to contain the outbreak of COVID-19 pandemic. In healthcare sector, data mining has been widely applied in many different applications such as predicting patient outcomes, modeling health outcomes, hospital ranking, and evaluation of treatment effectiveness and infection control, stability, and recovery [1, 23, 29].

In this study, we developed several data mining models for the prediction of 2019-nCoV-infected patients’ recovery. The models predict when COVID-19 infected patients would be recovered and released from isolation centers as well as patients that may likely not be recovered and lost their lives to COVID-19 pandemic. The models help the health workers to determine the recovery and stability of the newly infected persons with pandemic COVID-19. The models are developed with the dataset obtained from Korea Centers for Disease and Prevention (KCDC) and dataset instances of the death and recovery records of the infected 2019-nCoV pandemic were considered. Data mining algorithm which includes decision tree, support vector machine, naive Bayes, logistic regression random forest, and K-nearest neighbor were applied directly on the dataset using python programming language to develop the models.

The rest of the paper is organized as follows. Section 2 describes the overall methodology of the proposed system including data collection and preparation with data mining techniques. The experimental results with detailed discussions are described in Sect. 3. Lastly, Sect. 4 concludes the paper.

Methodology

Dataset Collection and Description

The dataset was obtained from KCDC which was made available on Kagge Website [3]. We used the epidemiological dataset of COVID-19 patients of South Korea. The dataset has 3254 instances with 8 attributes which include patient ID, global number (the number given by KCDC), sex, birth year, age, country, province, city, disease (TRUE: underlying disease/FALSE: no disease) infection case, infection order (the order of infection), infected by (the ID of who infected the patient), contact number (the number of contacts with people) symptom onset date, the date of symptom onset, confirmed date, the date of being confirmed, released date (the date of being released) deceased date (the date of being deceased) and state (state of the patients isolated/released/deceased).

Dataset Preparation

The dataset was prepared, and cleaned where only relevant attributes were extracted from the original dataset. The extracted dataset has only 1505 data instances with 5 attributes which include gender, age, infection_case and no_days (the number of days between the date the disease was confirmed and date the patients was released or die) and state of the patients (released or deceased). We considered only two states of the patient which include released and deceased while isolation state was excluded. Table 1 revealed the data type of the attributes and Table 2 showed the sample of some instances of the dataset. The missing value in the dataset reduces the prediction power and produces biased estimates leading to an invalid conclusion [28]. Therefore, we used last observation carried forward imputation technique to handle the missing values in the dataset. Figures 1, 2, 3, 4, 5 showed the frequency of each attribute of the dataset.

Table 1 Data type of each attribute
Table 2 Sample of the instances of the dataset
Fig. 1
figure 1

Frequency of sex attribute

Fig. 2
figure 2

Frequency of age attribute

Fig. 3
figure 3

Frequency of infection_case attribute

Fig. 4
figure 4

Frequency of no_days attribute

Fig. 5
figure 5

Frequency of state attribute

Data Mining Techniques/Algorithms

Logistic Regression (LR)

Logistic regression (LR) is used to determine the association between categorical dependent variables against the independent variables [9]. LR is used when the dependent variable has two values such as 0 and 1, yes and no or true and false and thus it is called binary logistic regression [22]. However, when the dependent variable has more than two values, multinomial logistic regression is used. A mathematical model of a set of explanatory variables for LR is used to predict a transformation of the dependent variables. LR transformation is written mathematically as:

$$i = {\text{Logistic}}\;{\text{regression}}\;(p) = \ln \left( {\frac{p}{1 - p}} \right).$$
(1)

Let, assume the dependent values are numerical of 1 and 0 where 0 represents negative value and 1 positive value as a binary variable. Therefore, the mean of the binary variable will the proportion of positive values. If p is the proportion of observations with an outcome of 1, then 1 − p is the probability of an outcome of 0. The ratio p/(1 − p) is called the odds and the LG is the logarithm of the odds or just log odds.

Support Vector Machine (SVM)

Support vector machine (SVM) is one of the supervised learning algorithms used for classification and regression [24]. For classification task in SVM involves testing and training data which contain some instances of the data [10]. Each instance in the training dataset contains one or more target values; therefore the main goal of SVM is to produce a model that will predict target value or values [24]. For regression, SVM applied by the introduction of alternative loss function which can be linear or nonlinear [10].

Decision Tree (DT)

Decision tree (DT) is used for classification tasks in data mining and successful technique due to its ability to handle both categorical and continuous data, simplicity and comprehensibility, DT builds tree into phases which include growth and pruning phases respectively [14, 15, 26]. In the first phase, a tree is built by partitioning data into a smaller set until each partition is pure, however, the split type of the data is solely dependent on the data type [19]. The splits for a numerical attribute C form the value of (C) ≤ y, where y is value in C domain. For splitting a categorical D, form the values of (D), B ∈ G, where G is a subset of domain (D) [7]. To remove the noise in the dataset, the pruning technique is used to get the final tree built when it is fully grown [11]. The growth phase is however computationally more expensive than the pruning phase of the decision tree [6].

Naive Bayes (NB)

Naive Bayes is one kind of data mining classification algorithm and used to discriminate dataset instances based on specified features or attributes [13]. NB is a probabilistic classifier and uses Bayes theorem for classification tasks [5]. Below is the Bayes theorem:

$$P \, (A|B) = \frac{{P\left( {B|A} \right)P\left( A \right)}}{P\left( B \right)} .$$
(2)

Random Forest (RF)

Random forest (RF) algorithm is an ensemble learning technique for data mining classification and regression tasks. The algorithm constructs a multitude of decision trees at training time and outputting [12]. RF data mining algorithm is the best to be used for any decision tree with overfitting to its training dataset [13].

K-Nearest Neighbor (K-NN)

K-nearest neighbor (K-NN) is a non-parametric and supervised data mining classifier used for regression and classification tasks [2]. In both tasks, the input variables consist of the K closes training dataset in the feature space. K-NN relies on labeled input data to learn a function so that to produce appropriate output when inputted unlabeled data [17]. In K-NN classification, the output is a class membership in which data instances is classified by a plurality vote of its neighbors, with the data instance being assigned to the class most common among its K-nearest neighbors while in K-NN regression, the output is the property value of data instance and this value is the average of the value of K-nearest neighbors [4].

Experimental Results

Python programming language was used for data mining predictive tasks. Python is a well-known general purpose and dynamic programming language that is being used for different fields such as data mining [30], machine learning [31, 32], and internet of things [33, 34]. Data mining algorithms are being implemented using python with the help of the special purpose libraries. The models were developed using fivefold cross-validation.

In decision tree, the model revealed in Fig. 6, the number of days attribute appeared to be the first splitting attribute which indicates the most important attribute. The model predicted a minimum of 5 days and a maximum of 35 days as the number days for COVID-19 patients to recover from the pandemic virus. The model has shown that another important attribute for predicting recovery of the COVID-19 patients is age attribute. The patients of age between 65–85 years are of high risk not to recover from the COVID-19 pandemic, patients of age between 26–64 years are likely to recover while patients of age between 1–24 years are recovered quickly from COVID-19 pandemic. From the model, we concluded old patients are at high risk of developing COVID-19 complications which may result in death.

Fig. 6
figure 6

Decision Tree model for COVID-19 infectedpatients’ recovery

Performance Evaluation of Model

Data mining models are evaluated using evaluation techniques to determine their accuracy [14]. The techniques determine the quality and efficiency of the model using the data mining algorithm or machine learning algorithms. These main performance evaluation techniques for the data mining model include specificity, sensitivity, and accuracy. However, in this study, only accuracy is considered to evaluate the developed models.

Accuracy determines the percentage of the dataset instances correctly classified for the model developed by the data mining algorithm. Expressed as:

$${\text{Accuracy}} = \frac{{{\text{tp}} + {\text{tn}}}}{{{\text{tp}} + {\text{tn}} + {\text{fn}} + {\text{fp}}}},$$
(3)

where tp is the True Positive, tn is the true negative, fp is the false positive while fn is the false negative.

The model developed with DT happened to be the most efficient with the highest percentage of accuracy of 99.85%, followed by RF with 99.60%, then SVM with 98.85% accuracy, then K-NN with 98.06% accuracy, then NB with 97.52% accuracy and LR with 97.49% accuracy. Table 3 has shown the results of the performance evaluation of the developed models.

Table 3 Performance evaluation of predictive data mining models

Findings and Discussions

The data mining algorithm which includes DT, SVM, NB, LR, RF, and K-NN were applied directly on the dataset using python programming language. However, the model developed with DT algorithm was found to be the most accurate with 99.85% accuracy which appears to be the highest among others as shown in Fig. 7:

Fig. 7
figure 7

Performance evaluation results of the models

The model predicted a minimum and maximum number of days for COVID-19 patients to recover from the virus. The model also predicted the age group of patients who are at high risk not to recover from the COVID-19 pandemic, those who are likely to recover and those who might be likely to recover quickly from COVID-19 pandemic. From the performance evaluation result of the models, the model developed with DT data mining algorithm is efficiently capable of predicting the possibility of recovery of infected patients from COVID-19 pandemic with the overall accuracy of 99.85% when compared with RF, SVM, K-NN, NB and LR with the overall accuracy of 99.60%, 98.85%, 98.06%, 97.52%, and 97.49%, respectively.

Conclusion

In the present study, data mining models were developed for the prediction of COVID-19 infected patients’ recovery using epidemiological dataset of COVID-19 patients of South Korea. DT, SVM, NB, LR, RF, and K-NN algorithms were applied directly on the dataset using python programming language. The model developed with DT was found to be the most efficient with the highest percentage of accuracy of 99.85%, followed by RF with 99.60% accuracy, then SVM with 98.85% accuracy, then K-NN with 98.06% accuracy, then NB with 97.52% accuracy and LR with 97.49% accuracy. The developed models would be very helpful in healthcare for the combat against COVID-19.