## 2 Materials and Methods
### Methodology
#### 2.2.3 Self-Organizing Maps (SOMs)  
SOMs are artificial neural networks characterized by unsupervised training [7]. In these maps, it is possible to project high-dimensional, complex data onto a two dimensional, regularly organized array of discrete locations (neurons) defined by the degree of similarity [6; 12]. SOMs are also suitable for clustering the data using clustering methods like k-means and Ward [6; 9]. Thus, SOMs achieve two objectives at once: reduce the dimensionality of a problem and display similarities between the data. The construction of any SOM leads to obtaining a prototypical object called _codebook vector_ that is associated to every neuron present in the map [23] and that is assigned to each neuron based on its closeness in the original multi-dimensional space. This means that data points that are close in the multi-dimensional space have nodes that are close on the two-dimensional neural map [6]. The _codebook vectors_ are acquired after iterative updates through the training of the map. This procedure involves three steps: (i) competition between nodes; (ii) selection of a winning node defined as the best-matching unit (BMU); and (iii) update of the _codebook vector_ of each node [6; 9; 12; 13; 23]. The SOM algorithm can be initialized using different processes, however, for this study the batch-algorithm with a linear initialization was used, in order to run the whole input data at once and accelerate the training phase [6; 9; 23]. One critical aspect of the elaboration of the SOM is selecting the topology to order the neurons. The most commonly used are rectangular and hexagonal [23]. However, [23] recommends using a hexagonal topology since it allows each neuron to have six equivalent neighbors (unless the neuron is located at the border of the map) and favors both horizontal and vertical directions. Accordingly, the SOM constructed in this study had a hexagonal topology. The other parameter that must be carefully defined is the dimension of the map. Larger maps allow a more detailed analysis but can have a greater number of empty neurons as well, while smaller maps might lose detail but have a greater predicting capability [23]. Since this is of critical importance, different criteria have been proposed to determine the optimal map size: (i) the optimal number of neurons is close to \(5\sqrt{n}\)[26]; (ii) the ratio of the axes should correspond to the ratio of the standard deviations in the data given by the two largest principal components [23; 25] as mentioned above; and (iii) the minimum values of the \"quantization error\" (QE) and \"topographic error\" (TE) [23]. Since both errors decrease gradually as the map size increases when using the former criterion, the local minimum values of both errors should be considered [10]. It is important to mention that the criteria can lead to maps with a high number of empty neurons, limiting the reliability of the map [26]. For this study, the approach followed by [12] using the change in the QE/TE ratio associated to different maps was used, taking the number of neurons derived from the [26]equation as the maximum number of neurons to be in the grid and about the ratio between first and second dimension from PCA as the ratio of neurons in the two dimensions. The associated QE and TE were calculated for 12 possible map structures ranging from 30 to 72 neurons using the Kohonen [20] and SOMbrero [21; 27] packages. As can be seen in Figure 3 when the number of neurons was 32 (4 \(\times\) 8), the TE/QE ratio achieved its minimum value. Accordingly, a 4 \(\times\) 8 map was used throughout this study. After defining both map size and topology, SOM training can take place. This process will continue until it reaches a predetermined small number, or after a certain number of processing cycles, using many iterations of the learning process to ordinate the _codebook vectors_[6; 13; 23]. These vectors have the same dimensions of the original data (i.e., seven) and are commonly visualized as _heatmaps_ that display every dimension in a single 2D grid.