# Damage Diagnosis for Offshore Wind Turbine Foundations Based on the Fractal Dimension
## 4 Results
### Evaluation Metrics
#### 4.1.2 Metrics for a Multiclass Classification Problem  
Metrics for a multiclass classification problem are based on a generalization of the metrics in Table 2 for many classes \(C_{i},\ i=1,\ldots,\ell\)[41; 42]. More precisely, with respect to the class \(C_{i}\), we define:  
* \(\mathsf{tp}_{i}\) as the true positive for \(C_{i}\), that is, the number of observations that belong to the class \(C_{i}\) that are correctly labeled as \(C_{i}\);
* \(\mathsf{tn}_{i}\) as the true negative for \(C_{i}\), that is, the number of observations that do not belong to the class \(C_{i}\) that are not labeled as \(C_{i}\);
* \(\mathsf{fp}_{i}\) as the false positive for \(C_{i}\), that is, the number of observations that do not belong to the class \(C_{i}\) that are wrongly labeled as \(C_{i}\); and
* \(\mathsf{fn}_{i}\) as the false negative for \(C_{i}\), that is, the number of observations that belong to the class \(C_{i}\) that are not labeled as \(C_{i}\).  
Table 3 presents the metrics for the evaluation of a multiclass classification problem. Although the quality of the overall multiclass classification is usually assessed in two ways: (i) macroaveraging; and (ii) microaveraging, Table 3 only considers the macroaveraging case, where all classes are treated equally, instead of microaveraging, where bigger classes are favored.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Metric** & **Formula** \\ \hline accuracy & \(\text{acc}=\frac{\mathsf{tp}+\mathsf{tn}}{\mathsf{tp}+\mathsf{fn}+\mathsf{fp}+ \mathsf{tn}}\) \\ precision & \(\text{ppv}=\frac{\mathsf{tp}}{\mathsf{tp}+\mathsf{fp}}\) \\ recall & \(\text{tpr}=\frac{\mathsf{tp}}{\mathsf{tp}+\mathsf{fn}}\) \\ F1 score & \(\text{F}_{1}=\frac{2\cdot\text{ppv}\cdot\text{tpr}}{\text{ppv}+\text{tpr}}\) \\ specificity & \(\text{tnr}=\frac{\mathsf{tn}}{\mathsf{tn}+\mathsf{fp}}\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Metrics for the evaluation of a binary classification problem.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Metric** & **Formula** \\ \hline average accuracy & \(\overline{\text{acc}}=\frac{1}{\ell}\sum_{i=1}^{\ell}\frac{\mathsf{tp}_{i}+ \mathsf{tn}_{i}}{\mathsf{tp}_{i}+\mathsf{fn}_{i}+\mathsf{fp}_{i}+\mathsf{tn}_{ i}}\) \\ average precision & \(\overline{\text{ppv}}=\frac{1}{\ell}\sum_{i=1}^{\ell}\frac{\mathsf{tp}_{i}}{ \mathsf{tp}_{i}+\mathsf{fp}_{i}}\) \\ average recall & \(\overline{\text{tpr}}=\frac{1}{\ell}\sum_{i=1}^{\ell}\frac{\mathsf{tp}_{i}}{ \mathsf{tp}_{i}+\mathsf{fn}_{i}}\) \\ average F1 score & \(\overline{\text{F}_{1}}=\frac{2\cdot\overline{\text{ppv}}\cdot\overline{\text{ tpr}}}{\overline{\text{ppv}}+\overline{\text{tpr}}}\) \\ average specificity & \(\overline{\text{tnr}}=\frac{1}{\ell}\sum_{i=1}^{\ell}\frac{\mathsf{tn}_{i}}{ \mathsf{tn}_{i}+\mathsf{fp}_{i}}\) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Metrics for the evaluation of multiclass classification problems, where \(\ell\) is the number of classes.  
Finally, it is important to note that in the next subsections all the presented confusion matrices follow the next nomenclature. The rows represent the actual class and the columns represent the predicted class. Label 0 corresponds to the case when the structure is healthy; label 1 corresponds to the structure with a replica bar; label 2 corresponds to the structure with a 5 mm cracked bar; and label 3 corresponds to the structure with an unlocked bolt in the jacket.