## 3 Methodology
### Data Preparation
#### 3.3.3 Feature Selection  
Feature selection involves carefully choosing a subset of relevant features while discarding those that are irrelevant or redundant for the model built. This process has been shown to significantly improve the efficiency of prediction tasks and enhance the used machine learning model's performance. By eliminating extraneous features, feature selection not only enhances the clarity of the results but also streamlines the prediction process [34]. Prioritizing the most influential features facilitates a clearer understanding of the underlying relationships between the predictors and the target variable, aiding in the extraction of meaningful insights and enabling more accurate decision making based on the model's output. Feature selection offers numerous benefits that significantly enhance data modelling. Firstly, it improves machine learning models' performance by reducing the risk of overfitting and minimizing the impact of irrelevant or noisy features. This ensures that the model captures the most relevant patterns and relationships within the data, leading to improved predictive accuracy. In addition to enhancing the model's performance, feature selection offers practical benefits. By excluding irrelevant features, it reduces the computational burden, leading to faster model training and improved overall computational efficiency. This streamlines data mining processes, enabling quicker analysis and more efficient decision making. After considering the available options for feature selection, the decision was made to employ a filter method. In the realm of feature selection, there are two primary approaches: filter methods and wrapper methods. Filter methods rely solely on the intrinsic characteristics of the data to identify relevant features, independent of any specific predictor. In contrast, wrapper methods incorporate predictor optimization as part of the feature selection process [35]. In this particular case, the filter method was chosen due to its computational efficiency, making it the preferred approach for this study. To evaluate the relationship between the independent variables and the dependent target variable, correlation tests were conducted. Two separate tests were employed, depending on the nature of the independent variable, whether it was numerical or categorical. A chi-square independence test was performed to evaluate the correlation between the categorical independent variables and the binary target variable. This statistical test aims to determine whether there is a relationship between two categorical variables by examining whether the observed frequency distribution significantly differs from the expected distribution under the assumption of independence. The calculation of the chi-square (\(\chi^{2}\)) statistic is given by the following:  
Figure 2: Box plot depicting the distribution of the “Foil_thickness” variable. \[\sum\chi_{i-j}^{2}=\frac{(O-E)^{2}}{E}, \tag{1}\]  
where \(O\) is the observed value, \(E\) the expected value, \(\chi_{i}^{2}\) the \(i\) cell's chi-square value, and \(\sum\chi_{i-j}^{2}\) the sum of all the cell chi-square values with \(i-j\) representing all the cells, i.e., from the first cell \((i)\) to the last \((j)\) cell. Table 3 provides a summary of the \(\chi^{2}\) value and its corresponding \(p\)-value that together assess the relationship between each independent categorical variable and the correspondent target variable. Based on the results presented in Table 3, there is insufficient statistical evidence to conclude that the variable \"External_Warehouse(Y/N)\" is not independent of the target variable \"Complaint (Y/N)\". As a result, the variable \"External_Warehouse(Y/N)\" was excluded from further analysis. A similar test was conducted to examine potential correlations between the remaining independent categorical variables that were not excluded following the initial analysis with the target variable \"Complaint (Y/N)\".