# Predicting the Survival of Primary Biliary Cholangitis Patients
## 3 Materials and Methods
### Modelling  
In this phase, the data resulting from the data preparation phase are used to feed the different Data Mining Models (DMMs) through the usage of the RapidMiner software. Given the fact that this is a classification approach, the following predictive models were used: DT, Random Forest (RF), Random Tree (RT), and Naive Bayes (NB), using a fine-tuning process through the optimisation of the parameters of each model. DT is an algorithm widely used for classification and regression tasks. The process of creating a DT works by greedily selecting the best split point in order to make predictions and repeat the process until the tree has a fixed depth. After the tree is constructed, it is pruned to improve the ability of the model to generalise to new data [20]. A common drawback of DTs is that they tend to overfit the training data. RF is one way to address this problem. RF is essentially a collection of DTs where, initially, a bootstrap sample is selected from the training data (random sample obtained with replacement) with the aim of inducing DT. This step is repeated until a set of DTs was created, each of which has its own predictive value. Hence, the final prediction is achieved by combining the output of all trees, which corresponds to the most frequent output of the ensemble [21]. RT works exactly like DT, with one exception: for each split, only a random subset of attributes is available. RT works similar to [PERSON]'s C4.5 or CART, but it selects a random subset of attributes before being applied [22]. Although the first three algorithms are tree-based, they do not perform the same. Because decision trees are an effective method of decision-making, it was decided to test different tree variations. In addition, the NB classifier was also used in this study. It is based on the Bayes Theorem, which is a probabilistic theorem that is used to find out the probability of something happening (\(A\)) by knowing that (\(B\)) has occurred, as mathematically expressed in (1). Therefore, given the problem at hand, the \(A\) variable can be considered the label/target, the attribute _status_. The \(B\) variable can be extended and seen as the rest of the features of the dataset [20]. \[P(A|B)=\frac{P(B|A)\times P(A)}{P(B)} \tag{1}\]  
Following the selection of the models, it was necessary to define the different sampling methods for testing. Full training was not considered in this study; instead, three sampling methods were considered, namely, Cross Validation (CV), using 10 folds, and Split Validation (SV), with a split ratio of 0.7 and a split ratio of 0.8. CV uses all data for training, whereas SV uses a certain percentage for training and the remaining for testing, as can be seen in Figure 5.  
Two missing values approaches were tested: the application of data replacement and the removal of instances with missing values. In addition, three data approaches were taken into consideration, the original dataset, the dataset with oversampling, and the dataset with undersampling. Oversampling consisted of the replication of cases of the minority class until a balanced distribution was achieved between the two classes. On the other hand, undersampling consisted of the removal of instances from the majority class until a balanced distribution was achieved. Both oversampling and undersampling techniques were achieved using the sampling operator, which creates a sample from a dataset by selecting examples randomly. The number of examples in the sample can be specified on absolute, relative, or probability basis depending on the setting of the sample parameter. The class distribution of the sample can be controlled by the balance data parameter. Additionally, to evaluate which attributes were the most relevant in the label's prediction, several scenarios were defined using different sets of attributes.