## 3 Methodology
### Modelling  
To tackle the task of predicting pallet collapse resulting from specific transportation activities, a thorough exploration of different modelling techniques was undertaken. In particular, Decision Tree and Random Forest models were considered and evaluated. These models were chosen for their strong interpretability, effectiveness in handling imbalanced data, ability to highlight feature importance, and overall performance. Decision Tree allows for a clear visualization of decision-making processes, which is crucial for understanding how specific variables influence the prediction of pallet collapses during transportation. On the other hand, Random Forest is particularly well suited for predicting rare events, such as pallet collapse in an imbalanced dataset. By averaging multiple decision trees, they effectively reduce overfitting and enhance generalization to unseen data, making them highly effective in this context. Also, both Decision Tree and Random Forest provide mechanisms for assessing feature importance, allowing one to identify and rank the factors that contribute to pallet collapse and guide the development of effective preventive strategies. Finally, prior studies, such as [PERSON] et al. [17] and [PERSON] et al. [15], have demonstrated the effectiveness of Decision Tree and Random Forest models in similar classification tasks. Although there are many other machine learning methods, such as Neural Networks, Multiple Discriminant Analysis, and Logistic Regression, which could also be applied, Decision Tree and Random Forest were chosen for their balance of performance, interpretability, and ease of use. In particular, Neural Networks, while powerful, often require larger datasets and more computational resources and can be challenging to interpret, which was not ideal for the goals of this study. For all approaches addressing the classification problem, Grid Search Cross-Validation (GridSearchCV) was utilized. As described by [PERSON] et al. [39], GridSearchCV partitions the parameter space into a grid and systematically evaluates every possible combination of hyperparameters. It then selects the combination that achieves the best performance according to the specified evaluation metrics. The dataset was initially divided into two distinct subsets: a training set and a test set. In this particular scenario, the training set was created by randomly selecting 80% of the original data, while the remaining 20% was allocated to the test set. As previously mentioned, the hyperparameters to be tuned were specified, and a list of hyperparameter combinations to be evaluated was generated. The training data underwent k-fold cross-validation, a method where the dataset is divided into \(k\) equally sized folds. In this case, \(k\) was set to 10, resulting in the creation of 10 folds. During each iteration of the cross-validation process, one fold is used as the validation set to assess the performance of different hyperparameter combinations, while the remaining \(k-1\) folds are combined to form the training set. This iterative process is repeated \(k\) times, providing a thorough evaluation of the model's performance. By using \begin{table}
\begin{tabular}{c} \hline \hline
**Variable** \\ \hline Destination\_Country \\ Trip \\ Temperature\_Delivery\_Date \\ WOOD\_PALLET \\ LAYER\_SEPARATOR \\ Foil\_thickness \\ Larger\_Side \\ Smaller\_side \\ Container\_Diameter \\ Container\_Bearing\_Diameter \\ Container\_Height \\ Conplaint (Y/N) \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Final variables to be included in the machine learning models after data preparation. multiple train-test splits, the risk of bias from a single split is reduced, thus improving the reliability of the model evaluation. Given the imbalanced distribution of the target variable, as illustrated in Figure 4, where the target variable \"Complaint (Y/N)\" distribution is shown, it was essential to address this imbalance to prevent the model from biasing towards predicting only the majority category.