# User Representation Learning for Social Networks:
## 4 Methodology  
The goal of the study is to evaluate different techniques for training a user embedding model. A, B, C, D, and E are the datasets used in the training of different models. It is also compared how well the models perform under different dataset scenarios. Input of a model can be a user's tweet text, user profile information, user activity data, or a combination of them depending on the proposed approach. The output of the model is a fixed size vector of \(R^{d}\). \(M\) and \(N\) represent the number of training and test users respectively and they are assigned to \(S\) predefined groups. The output of the model is evaluated by computing the similarities between training and test users. A prediction is considered correct if the user vector is most similar to the averaged group vectors of the training users of the same group. In all approaches, a d-dimensional \(\overset{\rightarrow}{T}\in\mathbb{R}^{d}\) vector is generated for each tweet in the data set. This phase is carried out with a different text representation method (\(Embedding\_Model\)) for each experiment. This is the part that differs from experiment to experiment. Then, embedding of users is obtained by element-wise-averaging of all their tweet vectors:  
\[\frac{1}{K}\ \ \ \sum_{v=1}^{K}\ \ \ Embedding\_Model(T_{v}) \tag{1}\]  
Here, \(K\) represents the number of tweets that a user has. Group embeddings are calculated for each group \(\ \theta_{k}(k=1,\ \dots,\ S)\) by element-wise-averaging of training user embeddings \(\ \alpha_{i}(i=1,\ \dots,\ M)\) of that group. The correctness of the embeddings of the test users \(\beta_{j}(j=1,\ \dots,\ N)\) is determined by comparing their distance to the embedding of the group they belong to with embeddings of other groups. Euclidean distance similarity measure is used in the distance evaluation [38]. \(\left\{\text{E}_{\alpha}^{i},\ \text{E}_{\beta}^{j},\ \text{E}_{\Theta}^{k}\in \mathbb{R}^{d}\right\}\) are a set of embeddings where \(\text{E}_{\alpha}^{i}\) shows the embedding of a training set user \(\ \alpha_{i},\text{E}_{\Theta}^{i}\) shows the embedding of a test set user \(\beta_{j}\), and \(\text{E}_{\Theta}^{k}\) shows the average embedding for group \(\ \theta_{k}\ \) calculated over training users. \[E_{\theta}^{k}=\frac{S}{M}\ \sum_{i=1}^{M}E_{\alpha}^{i}\ \textit{where}\ \alpha_{i}\in\ \theta_{k} \tag{2}\] \begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline
**Jaccard** & **G1** & **G2** & **G3** & **G4** & **G5** & **Overlap Coefficient** & **G1** & **G2** & **G3** & **G4** & **G5** \\ \hline
**G1** & \(1\) & **0.069** & 0.054 & 0.012 & 0.067 & **G1** & \(1\) & 0.130 & 0.145 & 0.035 & **0.273** \\
**G2** & \(1\) & \(0.037\) & 0.005 & 0.013 & **G2** & & \(1\) & 0.102 & 0.015 & 0.058 \\
**G3** & & & \(1\) & 0.018 & 0.038 & **G3** & & \(1\) & 0.037 & 0.106 \\
**G4** & & & & \(1\) & 0.024 & **G4** & & & \(1\) & 0.065 \\
**G5** & & & & \(1\) & **G5** & & & & \(1\) & 0.065 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Jaccard and overlap coefficient similarities of the lists. \(d_{jk}=\left|E_{\beta}^{j}-E_{\theta}^{k}\right|\) shows the euclidean distance between a test user \(j\)'s embedding and average embedding of group \(k\); we count the number of correctly predicted user embeddings, i.e., true positives, by the number of true operations on \(\left\{d_{jk}<d_{j\gamma}\right\}\) where \(\beta_{j}\in\theta_{k}\) and \(\beta_{j}\
otin\theta_{\gamma}\) for \(\forall\ j=1,\ \ldots,\ N\). Steps 1-2-3 in Figure 2 show the stages of obtaining text representations and are applied differently for each method. Steps 4-5-6 are applied in the same way in all approaches. In the implementation of the proposed user representation method, there is, in fact, no need for a dataset built from manually selected users of predefined categories. It is a fully unsupervised approach. That is, it does not consider the group labels in the training phase. However, such a dataset is used to generate group embeddings, and the group embeddings are used in the evaluation of user embeddings.