# Combining Machine Learning and Social Network Analysis to Reveal the Organizational Structures
## 2 Materials and Methods
### Classification  
The classification task was carried out using the Decision Tree [22], Random Forest, Neural Network (multi-layer perceptron) with L-BFGS solver and SVM algorithm with the polynomial kernel for different set up of following parameters of the experiment: number of recognized employee groups, minimum number of active months as well as the percentage of used features. The first parameter refers to the previously mentioned three-level hierarchy of employees, which can also be flattened to only two levels--management level and regular employees. The experiment was run with two values of this parameter to see how the performance of the algorithms vary with recognizing two and three groups of employees. The meaning of the second parameter is checked to see how the activity of a person may have influence on the result of the classification and therefore was examined to see if higher minimum months of employee activity correspond with better results. There is an assumption that some patterns of behavior required more time to be revealed, so the classification was run five times starting with one month minimum activity and ending with 5 months minimum activity. For each value, the network had to be recreated and features calculated again as some nodes were eliminated from the network. The third parameter examines the impact of the elimination of the most significant features. For this parameter, the experiment was carried out nine times, starting from all features to only ten percent of features with a continual decrease of ten percent. The importance of features for Decision Tree and Random Forest algorithms was determined based on Gini importance parameter from previously learned model. The Neural Network and SVM algorithm are not so easily interpretable and importance of the features cannot be obtained from the outcome of the model. In this case, the importance of the features must be determined before learning a model. For this purpose, the univariate feature selection method based on the chi-squared test was used. In the analyzed manufacturing company dataset, there was a problem with the unbalanced size of classes, which is common for a company structure where the group of regular employees is the most numerous and the management level has fewer members. However, the Enron dataset is much \begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature Name** & **Defined in** & **Brief Description** \\ \hline authorities centrality & Equation (8) & importance of node based on being referred to by hubs \\ \hline clustering coefficient & Equation (9) & degree to which nodes in a graph tend to cluster together \\ \hline the total numbers of cliques & Section 2.5 & total numbers of cliques in which an employee is assigned \\ \hline the biggest clique & Section 2.5 & size of the biggest clique for the specific node \\ \hline sent neighborhood variability & Equation (10) & difference between sets of neighbours a node sends emails to in consecutive months \\ \hline received neighborhood variability & Equation (10) & difference between sets of neighbours a node receives emails from in consecutive months \\ \hline general neighborhood variability & Equation (10) & difference between sets of neighbours a node communicates with in consecutive months \\ \hline overtime & Section 2.5 & a number of days an employee worked overtime (only for manufacturing company) \\ \hline the number of weekends worked & Section 2.5 & how many times an employee worked over weekends \\ \hline \hline \end{tabular}
\end{table} 
Table 3: _Cont._more balanced in each group, which may indicate a different management model in this company. To handle this problem the technique of oversampling was used to solve it, therefore to match the size of all minor classes to the size of the majority class of regular employees, SMOTE algorithm was used. To prevent data leakage, oversampling was performed only on a training set.