# Combining Machine Learning and Social Network Analysis to Reveal the Organizational Structures
## 2 Materials and Methods
### Features  
In the created social network, the centrality measures presented below have been calculated as input features for classification algorithms. These measures are also briefly described in Table 3.  
* indegree centrality: \[C_{IN}(v_{i})\ =\ |e_{ji}\in E|,j\
eq i,\] (1) where \(e_{ji}\) is the edge going from every node \(v_{j}\) to evaluated node \(v_{i}\). * outdegree centrality: \[C_{OUT}(v_{i})\ =\ |e_{ij}\in E|,i\
eq j,\] (2) where \(e_{ij}\) is the edge going from evaluated node \(v_{i}\) to every other node \(v_{j}\) in the network. Figure 2: Weighted and directed social network in a manufacturing company built upon e-mail communication. The colouring scheme is the same as for Figure 1: red nodes—first level management, orange nodes—second level management, blue nodes—regular employees. The algorithm used for visualisation is a force-directed large graph layout [39] with the root node with the highest betweenness. * betweenness centrality: \[C_{B}(v_{i})\ =\ \sum_{v_{s}\
eq v_{i}\
eq v_{d}}\frac{\sigma_{v_{s}v_{d}}(v_{i})}{ \sigma_{v_{s}v_{d}}},\] (3) where \(\sigma_{v_{s}v_{d}}(v_{i})\) is the number of shortest paths between nodes \(v_{s}\) and \(v_{d}\) passing through node \(v_{i}\) and \(\sigma_{v_{s}v_{d}}\) is the number of all shortest paths between \(v_{s}\) and \(v_{d}\). * closeness centrality: \[C_{C}(v_{i})\ =\ \frac{N}{\sum_{v_{y}}d(v_{y},v_{i})},\] (4) where \(N\) is the number of vertices in the network and \(d(v_{y},v_{i})\) is a distance between vertices \(v_{y}\) and \(v_{i}\). * eigenvector centrality: \[C_{E}(v_{i})\ =\ \frac{1}{\lambda}\sum_{k}a_{v_{k}v_{i}}\,C_{E}(v_{k}),\] (5) where \(A\ =\ (a_{i,j})\) is the adjacency matrix of a graph and \(\lambda\
eq 0\) is a constant. * page rank: \[C_{PR}(v_{i})\ =\ \alpha\sum_{k}\frac{a_{v_{k}v_{i}}}{d_{k}}\,C_{PR}(v_{k})+\beta,\] (6) where \(\alpha\) and \(\beta\) are constants and \(d_{k}\) is the out-degree of node \(v_{k}\) if such degree is positive, or \(d_{k}\ =\ 1\) if the out-degree of node \(v_{k}\) is null. Again, \(A\ =\ (a_{i,j})\) is the adjacency matrix of a graph. * hub centrality: \[C_{HUB}(v_{i})\ =\ \beta\sum_{k}a_{v_{i}v_{k}}\,C_{AUT}(v_{k}),\] (7) where \(A\ =\ (a_{i,j})\) is the adjacency matrix of a graph and \(C_{AUT}(v_{k})\) is the authority centrality of a node (see Equation (8)), \(\beta\) is a constant. * authority centrality: \[C_{IN}(v_{i})\ =\ |e_{ji}\in E|,j\
eq i,\]0 (8) where \(A\ =\ (a_{i,j})\) is the adjacency matrix of a graph and \(C_{HUB}(v_{k})\) is the hub centrality of a node (see Equation (7)), \(\alpha\) is a constant. Moreover, a local clustering coefficient was calculated for each node, which allows capturing density of connections between neighbors, as well as two additional features related to cliques:  
\[C_{IN}(v_{i})\ =\ |e_{ji}\in E|,j\
eq i,\]1  
where \(m_{v_{i}}\) is the number of pairs of neighbors of a node \(v_{i}\) that are connected. In the formula it is linked with the the number of possible pairs of neighbors of node \(v_{i}\), which is \(\frac{k_{v_{i}}(k_{v_{i}}-1)}{2}\), where \(k_{v_{i}}\) is the degree of a node \(v_{i}\). A clique is defined as a fully connected subgraph which means that each node has directed Overall, neighborhood variability is defined as the difference between sets of neighbors which the specific node communicates in the previous and the next month. Sent neighborhood variability considers a set of neighbors to which the given node was sending messages. Received neighborhood variability looks at a set of neighbors from which the given node had been receiving messages. General neighborhood variability uses a set of neighbors with which the node communicates, without distinguishing between sending and receiving messages. The Jaccard coefficient was used for calculating the difference between sets, so the coefficient takes values between 0 and 1 where 0 means totally different sets and 1 means identical sets. The Jaccard coefficient was calculated for each pair of alternating months.