# Machine Learning Approaches for Ship Speed Prediction towards Energy Efficient Shipping
## 2 Material and Methodology
### Results and Discussion  
As explained in Section 2.3, 41 features were reduced to 13 major input features and one SOG output feature, and the results of the descriptive statistics of the dataset after the pre-processing are shown in Table 4.  
To verify the validity of the potential models, regression analysis was carried out using the full-scale ship operation data and the regression results using the training and testing dataset were obtained. The classic approach splits the dataset into two randomized sets, those are, the training set and the testing set. The split ratio for the two datasets is between 80/20 and 50/50, depending on how large the dataset is. Here, the dataset was split 67% for training and 33% for testing data. To clearly understand the relationship between the dependent and independent features, a Pearson correlation analysis [34] was conducted using the training dataset. The correlation coefficient matrix result of SOG to the other measured features is shown in Table 5. The correlation between SOG and the other input factors is not high because the speed of the vessel is determined primarily by the torque and rpm of the vessel; furthermore, other weather-related features have a relatively low correlation. If data on the engines of the ships were collected, highly correlated features could have been included as main features. However, AIS and weather data only are used because the shipping company did not provide such engine data for security reasons, which often occurs in the shipping industry. Thus, AIS and weather-related features are the only ones that can be used to predict the ship's performance. Although only weather and dynamic information are used, the SOG can be still accurately predicted because engine rpm and torque are generally not volatile during the operation of vessels. In addition, the result shows that current speed and direction have less effect compared to other features, although the ship SOG is found to be influenced by the ocean current according to the description in Section 2.1. This is because, as shown in Table 4, the maximum current speed in our dataset is 1.515 knots and 75 % of the dataset has less than 0.399 knots, showing that our dataset does not have a highly volatile range of current speed. Nevertheless, because it is known that ocean current affects the performance of a ship, current speed and direction were included as input features to avoid losing the effect of the ocean current. Next, Bayesian optimization was performed to find the optimal hyperparameter values for each model. The considered hyperparameters for each model and their range of values are given in Table 6 along with the optimal hyperparameter values. The training used a 10-fold cross-validation in order to get a stable result. To identify the optimal models and hyperparameters, \(R^{2}\) was assessed for each model produced at each fold. To evaluate the post-training of the model, other accuracy measures were computed, as explained in Section 2.6. The result of the model accuracy measurements was also compared with the linear and 3 rd order polynomial regression model using the same independent feature sets. The overview of model accuracy is given in the plots of Figure 5. The three figures on the left indicate the calculated \(R^{2}\) values through 10-fold cross validations using GBR, linear regression, and 3 rd order polynomials, respectively, and the figure on the right indicates the ones using XGB, DTR, RFR, and ETR. The line inside of the box shows the median or second quartile of the model at k-fold, the top and bottom of the box show the first and third quartile, respectively. The whiskers indicated as horizontal lines also show the lowest and the highest points of data within a 1.5 interquartile range of