# Spectrum-Based Logistic Regression Modeling for the Sea Bottom Soil Categorization
## 4 The Results of the Logistic Regression Model  
Two logistic regression models were trained using training sets, and their accuracy was evaluated over training and test sets. The cost function was minimized by using 400 iterations of gradient descent. One of the models was trained using time series data, and it achieved an accuracy of 95.6% over the training set and 90% over the test set. The other model was trained using spectra data, achieving an accuracy of 95.33% over the training set and 94% over the test set. Corresponding confusion matrices are presented  
Figure 2: Stacked normalized power spectra [1/kHz]: (**a**) sandstone (site 3, orange line), site 4 (blue line). (**b**) sand (site 1, orange line), site 2 (blue line). in Table 2. These results show that both models effectively classified sand and sandstone with high accuracy, with the spectral model performing slightly better than the time series model. The quality of the model can be further assessed by considering the precision and sensitivity (recall). Precision is defined as the number of accurate predictions of a class divided by the number of total predictions of that class. Here, the precision of sand identification is 97.9%, and the precision for sandstone identification is 87.3% over the test set for the spectral data. For the time series data, the precisions are 88.3% for sand and 94.9% for sandstone over the test set. Sensitivity is defined as the number of accurate class predictions divided by the actual numbers of the same category. Here, the sensitivity of sand identification is 93%, and the sensitivity for sandstone identification is 96% over the test set for the spectral data. For the time series data, the precisions are 98% for sand and only 74% for sandstone over the test set. The precision and recall enable the calculation of the F1 score for both sand and sandstone, following Equation (1):  
\[F1=2\times\frac{Precision\times Recall}{Precision+Recall} \tag{1}\]  
Over the spectral data for sand identification, we obtain F1 = 95.38%, and for sandstone, we obtain F1 = 91.4%. The next step was to assess the performance of the models in actual field surveys, the required size of the datasets, and the number of iterations needed to achieve good results. For this purpose, the accuracies over the training set and the test set and the rock and sand identification sensitivity were calculated for different relative training set sizes (the number of used training examples divided by the number of features). The calculated values for each training set size are the average values of 100 runs with randomly chosen training examples (except for the entire set). These results appear in Table 3 and Figure 3. These \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \multicolumn{2}{c}{**a**} \\ \hline  & **Actual** & **Predicted rock** & **Predicted sand** \\ \hline Rock and Sand & 450 & 137 & 313 \\ \hline Rock & 150 & 133 & 17 \\ \hline Sand & 300 & 4 & 296 \\ \hline  & **b** & & \\ \hline  & **Actual** & **Predicted rock** & **Predicted sand** \\ \hline Rock and Sand & 150 & 55 & 95 \\ \hline Rock & 50 & 48 & 2 \\ \hline Sand & 100 & 7 & 93 \\ \hline  & **c** & & \\ \hline  & **Actual** & **Predicted rock** & **Predicted sand** \\ \hline Rock and Sand & 450 & 138 & 312 \\ \hline Rock & 150 & 134 & 16 \\ \hline Sand & 300 & 4 & 296 \\ \hline  & **d** & & \\ \hline  & **Actual** & **Predicted rock** & **Predicted sand** \\ \hline Rock and Sand & 150 & 39 & 111 \\ \hline Rock & 50 & 37 & 13 \\ \hline Sand & 100 & 2 & 98 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Confusion matrices for the trained model: (a) spectra training set; (b) spectra test set; (c) time series training set; (d) time series test set. results show that accuracy comparable to work carried out by [43] could be achieved with a relative training set of 2.45, compared to the 4.09 relative set size used by [43]. When utilizing the same relative set size, the logistic regression model achieved 94% accuracy over the test set (vs. the 80% accuracy of [43]).