## 3 Results
### Classification of Buildings According to Their Exposure to Seismic Risk  
Predictive models were developed to classify buildings into official BTs. Random Forest algorithms were trained and validated to assign the buildings in the study sample to a BT class according to the attributes obtained via GTs. A sensitivity analysis of the influence of building height was performed to confirm the degree of influence of height in seismic exposure analysis, as suggested by the literature. Table 6 shows the results of the Random Forest classifier (RF1) trained using the geospatial variables (except for building height) to classify the buildings of the sample-GED ca [46] into the eight classes (A-H) proposed in this study (Table 3). The estimated error ratio for the results obtained is 46.22%. In the previous matrix, it can be noted that more represented classes in the sample are predicted with higher accuracy, whereas less represented classes are not well assigned. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline
**ID** & **A** & **B** & **C** & **D** & **E** & **F** & **G** & **H** & **Error** \\ \hline
**A** & 2506 & 840 & 19 & 0 & 0 & 17 & 4 & 1 & 0.2601 \\
**B** & 1500 & 1327 & 7 & 0 & 0 & 11 & 1 & 1 & 0.5339 \\
**C** & 113 & 142 & 23 & 0 & 0 & 2 & 4 & 0 & 0.9190 \\
**D** & 3 & 11 & 4 & 0 & 0 & 0 & 0 & 0 & 1.0000 \\
**E** & 4 & 3 & 4 & 0 & 0 & 0 & 0 & 0 & 1.0000 \\
**F** & 289 & 176 & 6 & 0 & 0 & 30 & 6 & 0 & 0.9408 \\
**G** & 89 & 56 & 4 & 0 & 0 & 8 & 9 & 1 & 0.9461 \\
**H** & 24 & 4 & 0 & 0 & 0 & 0 & 0 & 7 & 0.8000 \\ \hline \end{tabular}
\end{table} 
Table 6: A confusion matrix of the building typology (A–H) assignment from the geospatial attributes, with Random Forest classifier RF1, without considering building height. \begin{table}
\begin{tabular}{c c c c c c} \hline  & \multicolumn{2}{c}{**GED Methodology**} & \multicolumn{2}{c}{**REM Methodology**} & \multicolumn{2}{c}{**Full Survey**} \\ \cline{2-6}  & **h/km\({}^{2}\)** & **EUR/km\({}^{2}\)** & **h/km\({}^{2}\)** & **EUR/km\({}^{2}\)** & **h/km\({}^{2}\)** & **EUR/km\({}^{2}\)** \\ \hline Preparation & 1.19 & 52.00 & 15.00 & 525.00 & 75.47 & 1698.00 \\ Field work & & & 4.50 & 270.00 & 313.21 & 5604.00 \\ Digitalization & 4.28 & 191.00 & 64.17 & 1189.00 & 381.13 & 5943.00 \\ \hline Total & 5.47 & 243.00 & 83.67 & 1984.00 & 769.81 & 13,245.00 \\ \hline \end{tabular}
\end{table} 
Table 5: A comparison of the efficiency in time and costs of three surveys conducted in the canton of San Jose (Costa Rica): GED methodology—the present study—, REM methodology [44] and a full survey [60]. The costs were estimated in Euros based on reference costs of engineering profiles in Spain (75 EUR/h for a superior technician, 45 EUR/h for an intermediate technician, and 15 EU/h for a basic technician and administration). This can be due to the over representation of Classes A and B, with confined or reinforced masonry being the most usual construction systems in San Jose de Costa Rica. Figure 16 presents the attributes that are most decisive for the algorithm to assign a class to each building. The most relevant variables in the RF1 classifier are the area of the building footprint, its location, and the Polsby-Popper irregularity index. With less relevance, we identified variables such as the neighborhood and district, complementing the location variables, and the roof material. A second classifier was developed, Random Forest RF2, which included building height. Random Forest RF2 included field-survey data of the height of the buildings from the sample-GED of the UCR Seismic Engineering Laboratory [46]. The classification was made in the eight classes proposed in Table 3 in order to compare RF1 and RF2 with the same conditions, and only adding the parameter of the height of the buildings. RF2 classification performs an estimated error rate of 13.55%, which is lower than in the case without height (RF1). RF2 classification achieves results that are good enough to characterize the building stock in the study area.