## 4 Methodology
### Embedding-Vector Creation  
After obtaining the dependency graph \(A\) and feature matrix \(X\) in the previous step, the aim is to generate an embedding matrix from \(X\) that can be used to measure the similarity between two classes by using a similarity metric such as the \(L_{2}\) norm. A higher similarity score indicates that the two classes are more dependent. To create the embedding matrix, a variational autoencoder (VAE) is used because VAE is capable of arranging the latent vectors such that two comparable vectors represent two comparable inputs. In this step, X is considered an input of VAE, and the reconstruction of X is denoted by \(\hat{X}\). The feature matrix \(Z\) is the latent space of VAE, where \(Z\in\mathbb{R}^{n\times l}\) and \(l\) is the length of each embedding vector in \(Z\). The VAE is trained to generate a reconstruction of \(X\) (\(\hat{X}\)) that is as similar as possible to X. The loss function of the VAE consists of three parts. First, the reconstruction loss (i.e., the mean squared error) measures how close the output (\(\hat{X}\)) is to the original input (\(X\)), ensuring that the model can accurately recreate the input data without losing important information, similar to checking how clear a photocopy is compared to the original document. Second, the architecture loss measures how well the latent embeddings (\(Z\)) preserve the relationships or connections between data points, as defined in the adjacency or structure matrix (\(A\)), ensuring that data points with similar neighbors have similar representations, like making sure friends are positioned close together in a social network map. Lastly, the latent distribution loss, calculated using the Kullback-Leibler (KL) divergence, ensures that the latent embeddings follow a normal (Gaussian) distribution, which keeps the latent space organized and smooth, allowing meaningful sampling and generation of new data points, similar to keeping marbles evenly spread in a bowl so that picking any one of them represents the whole set. Overall, these three components work together to ensure accurate reconstruction, structural consistency, and organized latent representation in the VAE model. Hence, we can calculate the loss function of VAE as follows:  
\[\mathcal{L}_{\text{VAE}}=\sum_{i=1}^{n}||X_{i}-\hat{X}_{i}||_{2}^{2}+\sum_{i=1 }^{n}||A_{i}-Z_{i}Z^{T}||_{2}^{2}+\text{KL}(q(Z|X)||p(Z)) \tag{6}\]  
where \(||\cdot||_{2}\) is the norm \(L_{2}\), \(n\) is the number of classes, \(X_{i}\) is the row \(i\) of the matrix \(X\), \(p(Z)\) is the prior distribution of \(Z\) where we assume it is the normal distribution (i.e., \(\mathcal{N}(0,I)\)), \(q(Z|X)\) is the probability of \(Z\) based on the input \(X\), and \(\text{KL}(q(Z|X)||p(Z))\) is the KL divergence function between \(Z\) and \(p(Z)\). The definition of this KL function is  
\[\text{KL}(q(Z|X)||p(Z))=\frac{1}{2}\sum_{j=1}^{d}(\mu_{j}^{2}+\sigma_{j}^{2}- \log\sigma_{j}^{2}-1) \tag{7}\]  
where \(d\) is the latent dimension, and \(\mu_{j}\) and \(\sigma_{j}\) are the mean and standard deviation of the \(j\)-th latent dimension (\(Z\)). In (6), the first term is the reconstruction loss, the second term is the architecture loss, and the last term is the latent distribution loss. The \(Z\) obtained from the VAE training with respect to the loss is used in the clustering phase.