## 2 Materials and Methods
### Prediction Models
#### 2.2.3 Supervised Learning Models  
The literature review states that mortality risk models are usually modeled through random forest, support vector machine, and logistic regression. These models were selected because of their implementation simplicity and lower computational resource consumption. All models were trained using the two feature matrices created earlier. The definition of the models and mode of use are shown below.  
Random Forest: The random forest algorithm is based on multiple decision trees. A decision tree delivers a classification result based on the properties and characteristics of the data. The most repeated result gives the result of a random forest among the trees. The _RandomForestClassifier_ function of Scikit Learn has several parameters to perform the training, such as the number of trees (_n_estimators_), tree depth (_max_depth_), the minimum number of samples to split the internal node (_min_samples_split_), the minimum number of samples per leaf (_min_samples_leaf_), the maximum number  
Figure 2: Feature matrix created by calculating mode every 3 years for each variable.  
of features (_max_features_), and the sample selection method for training each tree (bootstrap). The GridSearch method of Scikit Learn was used to find the optimal combination of these parameters with the best performance [26; 27].
* Support Vector Machine: SVM is an algorithm that aims to find a hyperplane in an N-dimensional space (where N is the number of features) that classifies the data points. There can be different hyperplanes to separate two classes, but the search is for the one with the maximum margin; i.e., the distance between two points of both classes is maximum. Choosing this hyperplane generates a more reliable classifier, which behaves well in different instances. It is worth mentioning that the dimension of the plane depends on the number of input features: if there are two input features, the hyperplane will be a line, while if the dimension is increased, there will be an N-dimensional hyperplane. There are also support vectors, which are points near the hyperplane. Finding suitable support vectors helps to maximize the SVM margin. The most crucial parameter for training an SVM is the kernel. In the case of this project, a sigmoid kernel was used for all implemented SVMs. In addition, the SVC function of Scikit Learn (with gamma = \"auto\") was used to train the models. [28].
* Logistic Regression: The logistic regression algorithm estimates the probability that an instance belongs to a particular class. If the estimated probability is greater than 50%, the model predicts that the instance belongs to that class (labeled \"1\") and otherwise predicts that it does not (labeled \"0\"). Unlike linear regression, logistic regression uses the logistic function to make the result of a linear equation lie between 0 and 1. The logistic function is defined by Formula 2. In this case, if a value is higher than the threshold (0.5), it means that the value belongs to class \"1\"; on the other hand, if the value is lower than the threshold (0.5), it means that the value belongs to class \"2\". The _LogisticRegression function_ of Scikit Learn was used to train the models [29].  
\[\mathrm{L}(n)=\frac{1}{1+exp(n)}\,, \tag{2}\]