# Framework for Behavioral Analysis of Mobile Networks
## 3 Proposed Framework
### Training Phase
#### 3.1.1 Cell Patterns Detection Block  
The SOM method is the main element of this block and it is executed as an unsupervised learning algorithm. Before the application of SOM, it is necessary to give the suitable format to the collected data in the pre-processing phase. The system works with KPIs, which are usually collected in the form of time series. The pre-processing phase is responsible for characterizing the time series to some significant statistics. Both SOM and Random Forest will work with the same statistics, so the configuration of these is made at the beginning of the framework. Pre-processing also applies a normalization of the statistics in order to prevent some KPIs from having more importance than others in the classification. As the normalization method, _Z-Score_ is used, which applies Equation (1) to each value to normalize,  
\[z=\frac{x-\mu}{\sigma} \tag{1}\]  
where \(z\) is the normalized value, \(x\) the current value of a specific KPI, and \(\mu\) and \(\sigma\) are the mean and standard deviation of the considered KPI, respectively. Once the data are  
Figure 2: Block diagram of training phase in the proposed framework. normalized, a vector for each cell is generated, including the normalized statistics of each considered KPI. This vector will be the input of the SOM algorithm. SOM is a widely used algorithm to cluster similar data from an unlabeled dataset, as discussed in the previous section. The ability of SOM to find similarities between different samples together with the absence of parameters that directly affect the number of clusters to be found by the algorithm, unlike K-Means or Canopy, are the main reasons for its preference over other unsupervised algorithms. Its operation is based on the construction of a two-dimensional map, where each point corresponds to a neuron. The concept of neuron in this algorithm represents the association between a point on the map and a weight vector, \(W=[W_{1},W_{2},W_{3}\ldots W_{N}]\), which represents a cluster. These weight vectors can be initialized to certain values, although random initialization is often used. Then, in each iteration, the values of weight vectors are updated according to the input data and other configurable parameters. Several parameters decide the operation of the algorithm; therefore, these must be configured before starting the execution of SOM with initial values that can change during execution. Some of the most important parameters are:  
* Learning rate (\(\alpha\)). It indicates how much is learned from the input data in each iteration. It must be set to an initial value that will decrease with each iteration according to the decay function. * Neighborhood rate (\(\sigma\)). It indicates which of the neurons on the map must be considered neighbors. It is interpreted as a maximum distance to the activated neuron in each iteration. Those neurons included in this distance are considered as neighbors and therefore update their weight vector. As the learning rate indicator, it must also be set to an initial value that will decrease with each iteration. * Maximum of iterations. Indicates the maximum number of iterations that the algorithm performs if it does not reach convergence. * Size of map. It is adjusted according to Expression (2), \[x\cdot y\simeq 5\cdot\sqrt{N}\] (2) where \(x\) and \(y\) are the map dimensions and \(N\) is the number of input samples. The dimensions have to be chosen to get closer to the calculated value. * Decay function. Function used to reduce learning and neighborhood rates in each iteration of the algorithm. The default function is shown in Expression (3), \[x=\frac{x_{n}}{1+\frac{t}{T}}\] (3) where \(x_{n}\) is the new rate calculated and \(x\) is the rate of the previous iteration, \(t\) is the current iteration and \(T\) is half of maximal iterations allowed. Once these parameters are configured, the steps that the algorithm will follow in each iteration during its execution are the following:  
1. The Euclidean distances between each neuron and the input data are calculated.