# Assessment of Hull and Propeller Degradation Due to Biofouling Using Tree-Based Models
## 4 Development of Data-Driven Models
### Feature Engineering
The concept of distance correlation is based on the notions of distance covariance and distance variance. The distance covariance quantifies the similarity of paired observations in terms of their distances to other observations, while the distance variance measures the dispersion of the distance between paired observations. By normalizing the distance covariance with the square root of the product of the distance variances, the distance correlation is obtained. The resulting measure ranges between 0 and 1, with 0 indicating independence and 1 indicating perfect dependence. This makes the distance correlation a valuable tool for feature selection, as it captures a wide range of relationships and provides a comprehensive understanding of the data. Specifically, the distance covariance between two random variables \(X\) and \(Y\) is defined as the square root of their distance variance, as follows:  
\[dCov(X,Y)=\sqrt{dVar(X,Y)} \tag{11}\]  
The distance variance between \(X\) and \(Y\) measures the dispersion of the distances between paired observations. It is calculated as follows:  
\[dVar(X,Y)=\frac{1}{n^{2}}\sum_{i=1}^{n}\sum_{j=1}^{n}S\big{(}X_{i},X_{j}\big{)} S\big{(}Y_{i},Y_{j}\big{)} \tag{12}\]  
where \(S\big{(}X_{i},X_{j}\big{)}\) and \(S\big{(}Y_{i},Y_{j}\big{)}\) represent the Euclidean distances between observations \(X_{i}\) and \(X_{j}\), and between \(Y_{i}\) and \(Y_{j}\), respectively, and n represents the sample size. The distance correlation between \(X\) and \(Y\) is obtained by normalizing the distance covariance \(dCov(X,Y)\) with the square root of the product of the distance variances \(dVar(X)\) and \(dVar(Y)\) of \(X\) and \(Y\), respectively, as follows:  
\[dCor(X,Y)=\frac{dCov(X,Y)}{\sqrt{dVar(X)dVar(Y)}} \tag{13}\]  
The correlation analysis confirmed what was expected: RPM and STW were the candidate features with the highest correlation values with the SHP variable, which highlighted their importance as predictors. However, the RPM variable was not included as a feature because it would limit the applicability of the model as an emulator, even though it would increase its predictive accuracy. It is worth mentioning that the correlation coefficient values of the longitudinal components of the relative wind speed and the significant wave height were higher than the respective values of both the transverse components and the original variables. In addition, it is worth noting that although the correlation coefficient of the rate of turn (RoT) variable had a small value, it was useful to include a variable related to maneuvering. On the other hand, current speed, resulting in the difference between SOG and STW, did not directly impact the hydrodynamics and ship speed-power performance. However, according to [27], the wave-current interaction can affect the wave height, as the wave field significantly changes as it interacts with following and opposing \begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature** & **Unit** & **Distance Correlation Coefficient** \\ \hline Wind y & m/s & 0.0939 \\ \hline Current & kn & 0.1737 \\ \hline Days & days & 0.2895 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: _Cont._currents. Therefore, it might be assumed that the current speed can indirectly affect the ship's resistance and propulsion power requirements. On the other hand, the correlation analysis revealed a small but non-negligible relationship between current speed and SHP, with a correlation coefficient similar in magnitude to other environmental factors like wave height and wind speed. This suggests that current, as a proxy for wave-current interaction, may provide useful information to the model in predicting the ship's performance. Therefore, feature selection was based on a combination of domain knowledge and correlation analysis using the distance correlation method.