## 5 Using Advanced Supervised ML Regression Models for a Better Fit
For example, as \(\
u\) approaches infinity, the Matern kernel converges to the RBF kernel. Of special interest are two constant values of the parameter \(\
u\) with which we eliminate the modified Bessel function from the kernel: \(\
u=1.5\) and \(\
u=2.5\). For these cases, the modified Bessel function vanishes from the kernel expression and the predicted values produced using this kernel yield very good results without over-smoothing the predicted values. After the numerical testing procedure, we found that the Matern kernel with \(\
u=1.5\) yielded the best results when applied to our dataset:  
\[k(x,x^{\prime})=\sigma^{2}\cdot\left(1+\frac{\sqrt{3}}{l}\cdot|x-x^{\prime}| \right)\cdot\exp\left(-\frac{\sqrt{3}}{l}\cdot|x-x^{\prime}|\right) \tag{6}\]  
The length-scale parameter \(l\) can be set differently for all dimensions of the input data, which makes the kernel anisotropic. We will use this anisotropic variant of the Matern 3/2 kernel given by Equation (6). The hyperparameters \(\sigma\) and \(l\) of the selected kernel are optimized in the scikit-learn library by maximizing the log-marginal-likelihood (LML). We conducted a number of optimizer restarts since it is well-known that the LML may have multiple local optima. By performing the optimization procedure repeatedly, the best possible hyperparameter values are obtained. In the optimization procedure, the first optimizer run starts from the initial hyperparameter values of the kernel whereas the subsequent runs are conducted from hyperparameter values that have been chosen randomly from the range of allowed values. The training of the GP regression model and the optimization of hyperparameters were performed similarly to before on the training set containing 90% of the dataset samples. Training and the optimization of hyperparameters of the anisotropic Matern 3/2 kernel yielded the following optimal values of the kernel for our dataset: \(\sigma=30.3\) and \(l=\{13,\,249,\,69.2\}\). Similar to the previous section, the trained GP regression model was validated on the test set containing the remaining 10 % of dataset samples. Figure 9a,b depict the actual vs. predicted values obtained using the trained GP regression model for the training set and the test set, respectively. Figure 10a,b depict the residuals vs. predicted results obtained using the trained GP regression model for the training set and the test set, respectively. It is immediately noticeable that introducing an advanced regression model yielded even better-fit results with maximum residual values peaking at cca 1 m.  
The regression quality metrics also reflect this visual analysis (Table 6)--the \(R^{2}\) is much closer to 1, and the RMSE is almost nine times lower for both the training and test sets. Although the predicted results look homoscedastical in nature, a Breusch-Pagan test was again performed to confirm the elimination of previously observed heteroscedasticity. The trained and optimized GP regression model yielded _p_-values of 0.18147 for the training set and 0.087989 for the test set, which is above the usual cut-off value of 0.05. Therefore, we can conclude that when using the trained GP regression model to interpolate effective length values in the prescribed input data intervals, heteroscedasticity will be absent from the predicted results. Figure 10: Residuals vs. predicted values obtained using the GP regression model: (**a**) Training set, (**b**) Test set. Figure 9: Actual vs. predicted values obtained using the GP regression model: (**a**) Training set, (**b**) Test set.