# Near-Optimal Weather Routing by Using Improved A* Algorithm
## 4 Case Study
### Prediction of Ship's Estimated Time of Arrival
#### 4.1.3 Learning-Based Regression Model  
As shown in Section 4.1.2, AIS and weather data include many parameters, and their number is large, so that a classical analytical regression model cannot be used [29]. Therefore, this study used a machine-learning-based regression model to address effectively the large number of AIS and marine weather data. To generate the machine-learning-based regression models, SOG is used as a target variable that is used to calculate the values of the ETA. In the given grid map \(G\), the expected ETA value for traversing between the two nodes \(u,v\in\mathbf{N}\) is calculated as follows:  
\[ETA=\frac{2 distance}{SOG(u)+SOG(v)} \tag{9}\]  
Using Equation (9), the ETA is analytically calculated by dividing the distance into the arithmetic mean of the expected SOG values at each node \(u\) and \(v\). Moreover, the distance can be calculated by using the haversine method discussed in Section 3.2.1. Equation (9) can produce inaccurate results depending on ship and weather conditions at the two points, but the data used in this study are defined in map grid, so Equation (9) is the most economical and realistic way of deriving ETA values in terms of calculation. The ETA corresponds to the objective function to be minimized during the ship route-finding process; therefore, the optimal route derived from the routing process is the ETA-based optimal route. Data Preprocessing  
Prior to data preprocessing, candidate features, which are used to generate the machine-learning model for the SOG, should be chosen. The route optimization is performed under the condition that the ship is always in operation, so only the data where the navigational status was \"underway using engine\" was extracted. Additionally, because the progress direction of the ship within the grid map corresponds to COG, the true heading was not selected as a feature for SOG prediction. Once the unnecessary features are removed, the raw data need to be refined. The AIS data include anomalies because of sensor malfunction or some other reasons, such as unexpected external disturbance; thus, they should be identified and removed before analysis. The anomalies in the AIS data are either so large or so low that a simple comparison with the mean value makes it easy to identify them. In addition, there are not many outliers in AIS datasets, and complicated statistical analysis may result in reducing the efficiency of the routing process. Thus, in this study, numerical thresholds were used to screen out the outliers, which is also known as \"rule-based preprocessing.\" Afterward, categorical data in string format excluding operational status information, such as MMSI or IMO number, were removed because they could not be used as input parameters for the regression model. For numerical data, such as latitude, longitude, and COG, data outside the upper and lower limits determined based on physical limits were removed as outliers. Unlike the AIS data, marine weather data do not require additional data preprocessing because they are received in a state of being refined from a specialized company. Consequently, data preprocessing was carried out only for AIS data. Table 5 summarizes the bound values of each numeric AIS factor. Feature Extraction and Feature Selection  
The wind and ocean current biaxial velocities were converted into speed and angle components through vector operations to provide an intuitive understanding of the contribution of wind and \begin{table}
\begin{tabular}{c c c} \hline \hline
**AIS Data Type** & **Lower Bound** & **Upper Bound** \\ \hline Latitude & \(-90\) & \(90^{\circ}\) \\ Longitude & \(-180^{\circ}\) & \(180^{\circ}\) \\ COG & \(0^{\circ}\) & \(360^{\circ}\) \\ Navigational status & “Underway using Engine” \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Bound values for data filtering. ocean current to the composition of the regression model. Here, the angle is defined as the clockwise direction in relation to zero degree in the north direction.