# JARUA: Joint Embedding of Attributes and Relations for User Alignment across Social Networks
## 4 Methodology
### Iterative Training  
Iterative training is one of the more practical ways of expanding training data, which provides a method to maximize the use of labeled data on UA issues. The iterative training algorithm applied in this study consists of two steps:  
1. Train the model with a set of initially labeled data, i.e., pre-linked user pairs.
2. Predict the new auto-labeled data iteratively and add them to the next iteration until no new one can be populated.  
The quality of the newly labeled data generated in the iterative training is another potential problem. We assess the populated data using the following two measures. First, link users on both sides of a predicted pair should satisfy the nearest neighbor (NN) constraint [48], i.e., each user is the NN of the other. In most cases, the NN relation between two users is asymmetrical. In other words, although a user \(u_{i}\) in \(G^{X}\) is the most similar to \(u_{j}\) in \(G^{Y}\), there might be another user in \(G^{Y}\) that is closer to \(u_{i}\). Therefore, user pairs are considered newly aligned pairs only if they are mutually nearest neighbors of each other. Second, the method mentioned above suffers from a limitation. Far-apart user pairs may still satisfy the NN constraint if there exists no user closer to each other. Because higher similarity of potential pairs indicates higher prediction precision, we only fill the user pairs whose similarity is greater than a certain threshold \(\tau\) into the aligned user pair set \(L\). This work takes cosine distance as the similarity measure for iterative training. A detailed procedure is given in Algorithm 1.  
```
Input: Two networks to be aligned \(G^{X}=(U^{X},R^{X},A^{X})\) and \(G^{Y}=(U^{Y},R^{Y},A^{Y})\), a set \(P\) of pre-aligned user pairs, \(U^{TX}\subseteq U^{X}\) and \(U^{HY}\subseteq U^{Y}\) represent candidate user sets that does not exist in \(P\), respectively. Output: The updated set \(P\) of model pre-aligned user pairs.
1 repeat
2 Reinitialize the model;
3 Train the model based on \(G^{X}\), \(G^{Y}\) and \(P\);
4\(P^{\prime}\leftarrow\phi\);
5 for\(u_{i}\in U^{TX}\)do
6\(u_{i}^{\prime}\gets NN(u_{i},U^{HY})\);
7 if\(NN(u_{i}^{\prime},U^{TX})=u_{i}\) and \(\left(u_{i},u_{i}^{\prime}\right)>\tau\)then
8\(P^{\prime}\gets add((u_{i},u_{i}^{\prime}))\);
9\(U^{TX}\gets U^{TX}-u_{i}\);
10\(U^{TX}\gets U^{HY}-u_{i}^{\prime}\);
11\(P\gets P\cup P^{\prime}\);
12
13 until\(P^{\prime}=\emptyset\);
```  
**Algorithm 1**Iterative procedure of JARUA.  
Algorithm 1 takes the candidate user sets \(U^{TX}\) and \(U^{HY}\) whose elements do not belong to pre-linked pairs as the input. The algorithm output is the extended pre-linked set \(P\) with more desired links, which terminates when no newly linked user pairs can be discovered, i.e., \(P^{\prime}\in\emptyset\) (line 12 in Algorithm 1). First, it is required to search for the nearest neighbor member \(u_{i}^{\prime}\in U^{HY}\) of each user \(u_{i}\in U^{TX}\) by a constraint \(u_{i}^{\prime}\gets NN(u_{i},U^{HY})\) (line 6 in Algorithm 1). Second, the algorithm determines whether the new link pair \((u_{i},u_{i}^{\prime})\) is reasonable or not by the reverse judgment of nearest neighbor \(NN(u_{i}^{\prime},U^{TX})=u_{i}\) and the similarity threshold classification according to parameter \(\tau\) (line 7 in Algorithm 1). Finally, all new user pairs that satisfy the linked pair criteria are stored in set \(P^{\prime}\) for updating the set \(P\) of pre-aligned user pairs (lines 8-11 in Algorithm 1).