# Assessing Fatality Risks in Maritime Accidents: The Influence of Key Contributing Factors
## 4 Materials and Methods
### Methodology
#### 4.2.2 Classification and Regression Tree (CART)  
The classification and regression tree (CART) methodology is a popular machine learning technique that constructs decision trees for classification or regression tasks. This method splits the data into subsets based on the values of the predictor variables, creating a tree structure where each internal node represents a decision based on an input variable, each branch represents the outcome of that decision, and each leaf node represents a predicted class for the outcome variable [40; 41].  
In the context of classification, in the task of predicting fatality in maritime accidents, the goal of CART is to predict the class of an outcome variable (fatal or non-fatal accident) by creating a tree that recursively partitions the data. The algorithm starts with the complete dataset and identifies the variable along with its threshold, which optimally splits the data into two subsets, based on the impurity of the resulting subsets. Various metrics can be used to measure impurity, with the Gini index and entropy being the most commonly employed. The tree structure is formed by iteratively dividing the data into smaller subsets according to the values of the input variables. This process continues until a stopping criterion is satisfied, such as a minimum number of observations per leaf or a specified maximum tree depth. In this paper, we set the maximum tree depth to 5, with a minimum of 2% records in the parent node, 1% records in the child node, and a minimum change in impurity of 0.0001 as the stopping criteria [40].  
The Gini index, which assesses the likelihood of incorrectly classifying a randomly selected data point from a node, is calculated as follows:  
\[Gini\ Index=1-\sum{p_{i}}^{2} \tag{4}\]  
where \(p_{i}\) is the proportion of samples in class \(i\) at the node. The Gini index is minimised when all the samples at a node belong to the same class.  
Entropy, another measure of impurity, quantifies the amount of information or uncertainty in a dataset and is computed as:  
\[Entropy=-\sum{p_{i}}\cdot\log{p_{i}} \tag{5}\]  
where \(p_{i}\) is the proportion of samples in class \(i\) at the node. Entropy reaches its minimum when all the samples at the node are of the same class.  
The Gini index and entropy are the primary impurity measures used in the CART algorithm. Some research indicates that the Gini index often performs marginally better in classification tasks, whereas entropy may be more sensitive to variations in data distribution.  
A key advantage of the CART method is its ability to handle both categorical and continuous input variables. CART models are robust against multicollinearity among input variables and outliers in the dataset. They can also manage missing data by employing surrogate variables for each predictor. However, one major drawback is the potential for overfitting, where the model becomes overly complex and captures noise rather than general patterns. To mitigate overfitting, CART models can be pruned. Pruning is a process that involves removing branches that do not significantly enhance the model's performance. In this paper, the CART tree was pruned to enhance generalisation and reduce overfitting [42].