## 3 Methodology
### Data Preparation
#### 3.3.4 Data Discretization  
Data discretization is a fundamental data preprocessing technique that involves converting continuous data into discrete or categorical forms by partitioning a continuous variable into a limited number of intervals or categories.  
The research described in [PERSON] and [PERSON] [37] emphasized the importance of data discretization in reducing the dimensionality and complexity of continuous variables. This reduction can lead to improved computational efficiency, enhanced model generalization, and a better understanding of underlying patterns and relationships within the data. Considering these benefits, the decision was made to discretize the variable \"Distance\" into three distinct bins, as shown in Table 6. As a result of this discretization process, a new variable named \"Trip\" was created.  
To assess the correlation between the newly created variable \"Trip\" and the target variable, a Spearman's rank correlation test was conducted. The [PERSON]'s rank correlation coefficient (\(r_{S}\)) was used to measure the strength and direction of the relationship between two variables, whether continuous or ordinal. Given that \"Trip\" is an ordinal variable, the [PERSON]'s rank correlation test was deemed the appropriate method for this analysis.  
The [PERSON]'s rank correlation focuses on the rank order of the two datasets under study. Its coefficient can take values between \(-1\) and \(1\) (one), where a value of \(1\) (one) indicates a perfect monotonic increasing relationship, while a value of \(-1\) indicates a perfect monotonic decreasing relationship. The closer the absolute value of \(r_{S}\) is to \(1\) (one), the stronger the monotonic relationship between the datasets [38].  
The calculation of the [PERSON]'s rank correlation coefficient (\(r_{S}\)) is given by the following:  
\[r_{S}=\frac{\sum_{i=1}^{n}(x_{i}-\bar{x})\times(y_{i}-\bar{y})}{\sqrt{\sum_{i= 1}^{n}(x_{i}-\bar{x})^{2}}\times\sqrt{\sum_{i=1}^{n}(y_{i}-\bar{y})^{2}}}, \tag{4}\]  
where \(x_{i}\) is the rank of the measurement for the \(i\)-th sample of the \(X\) (\"Trip\") set, \(\bar{x}\) the sample mean of \(X\), \(y_{i}\) the rank of the measurement for the \(i\)-th sample of the \(Y\) (\"Complaint (Y/N)\") set, \(\bar{y}\) the sample mean of \(Y\), and \(n\) the datasets' size.  
Based on the findings presented in Table 7, one can conclude that there is a statistically significant correlation between the variables \"Trip\" and \"Complaint (Y/N)\". This result supports the effectiveness of the discretization applied to the initial continuous values, as it successfully captured the underlying relationship between the variables.  
In Table 8 the variables to be modelled after the data preparation phase are presented.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Distance** & **Trip** \\ \hline \(<\)150 & short \\ \([150,2000]\) & medium \\ \(>\)2000 & long \\ \hline \hline \end{tabular}
\end{table}
Table 6: Discretization of the variable “Distance” and consequent creation of the variable “Trip”.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Variable** & \(\mathbf{r_{s}}\) & \(\mathbf{p}\)**-Value** \\ \hline Trip & 0.07 & \(4.14\times 10^{-7}\) \\ \hline \hline \end{tabular}
\end{table}
Table 7: [PERSON]’s rank correlation coefficient test: “Trip” vs. “Complaint (Y/N)”.