## 2 Materials and Methods
### Data Preprocessing  
The core of the designed and employed modeling effort lies in the development of a Machine Learning (ML) model for binary classification \(f:\mathbb{R}^{n}\times\mathbb{R}^{n}\rightarrow\{-1,+1\}\) that, given a pair of structures \((s_{i},s_{j})\) with corresponding feature vectors \(\mathbf{x}_{i},\ \mathbf{x}_{j}\in\mathbb{R}^{n}\), is capable of predicting whether \(s_{j}\) should rank higher than \(s_{i}\) or vice versa [22].  
However, it can be readily observed from Figure 2 that the \"Red\" label heavily dominates the sampled dataset. This so-called \"class imbalance problem\" has significant adverse effects on any machine learning algorithm [23; 24; 25; 26]. It leads the model to be skewed towards the majority class, creating bias and rendering the algorithm unable to adapt to the features of the minority classes [23; 24]. This imbalance can be treated by undersampling the majority class, and there are numerous methods in the literature in order to do so [27; 28; 29]. These methods include randomly selecting a subset of the samples in the majority class [30; 31], or using model-based methods such as NearMiss, Tomek. Links, or Edited. Nearest Neighbours [27; 28; 29]. NearMiss-2 was found to perform the best, and is used in the sequelae. We undersampled the majority class by a factor of 50% in order to achieve a relative class balance, which, as mentioned, is crucial to the performance of machine learning algorithms. The distribution of structures across the above damage categories after undersampling is shown in Figure 3.  
Next, in order to represent the pair \((\mathbf{x}_{i},\ \mathbf{x}_{j})\) using a single feature vector \(\mathbf{x}^{new}\) as input for the machine learning model, we considered the pairwise transformation \(T:\ \mathbb{R}^{n}\times\mathbb{R}^{n}\rightarrow\mathbb{R}^{n}\), which is a linear combination of the feature vectors \(\mathbf{x}_{i},\ \mathbf{x}_{j}\) and the feature vectors \(\mathbf{x}_{i}\). The resulting transformation is  
Figure 3: Distribution of structures across the damage spectrum after undersampling.  
\(\mathbb{R}^{n}\) with \(T(\mathbf{x}_{i},\mathbf{x}_{j})=\mathbf{x}_{j}-\mathbf{x}_{i}\). Other pairwise transformations can be employed, e.g., \(T_{2}:\mathbb{R}^{n}\times\mathbb{R}^{n}\rightarrow\mathbb{R}^{2n}\), with \(T_{2}(\mathbf{x}_{i},\mathbf{x}_{j})=[\mathbf{x}_{i};\mathbf{x}_{j}]\), i.e., appending \(\mathbf{x}_{j}\) to \(\mathbf{x}_{i}\)[32]. However, the transformation employed in the present study has the advantage of a more natural interpretation, which is the goal of this study. For a example, a value of 2 storeys in the transformed dataset indicates that structure \(s_{j}\) has two more storeys than \(s_{i}\). Similarly, a transformed value of \(-1\) for the \"pounding\" attribute indicates that \(s_{i}\) suffered from bounding while \(s_{j}\) did not.  
A similar transformation was applied to the labels of the damage categories. To this end, the labels where first ranked in ascending order, i.e., Green, Yellow, Red, Black \(\rightarrow\{1,2,3,4\}\). Then, for a pair of structures \((s_{i},s_{j})\) with \((y_{i},y_{j})\in\{1,2,3,4\}^{2}\) and \(y_{i}\
eq y_{j}\), the transformed target variable was \(y^{new}=sign(y_{j}-y_{i})\), where \(sign\) denotes the sign function. Thus, for example, a transformed variable of \(-1\) indicates that \(s_{j}\) suffered more severe damage than \(s_{i}\). As the focus of this research is to gauge the contribution of the involved parameters to the extent of a structure's relative damage, pairs with \(y_{i}=y_{j}\) were not included in the transformed dataset.  
Thus, the final transformed dataset had inputs \(\mathbf{X}^{new}\) and outputs \(y^{new}\) obtained via the above transformations described.