## 3 Materials and Methods
### PreferSAGE-SCF
#### 3.3.2 PreferSAGE Sampling  
The neighbor node sampling method used in this paper is importance sampling, which is achieved through weighted random walks between nodes. Different from the true neighbors on the graph, the importance sampling defines the top n nodes that have the greatest influence on the starting nodes as neighboring nodes. Algorithms such as GCN and GraphSAGE are based on the sampling of real neighbors, only sampling and aggregating the real neighbors on the graph structure. However, using importance sampling can identify relatively far but more important nodes and treat them as neighboring nodes for sampling and aggregating. This method effectively improves the propagation efficiency of node features. The PinSAGE algorithm uses the normalized number of hits of nodes during random walks as the basis for importance sampling. In this paper, the idea proposed by PinSAGE is defined as the spatial importance of nodes (not considering user features), and the authors believe that the importance of nodes is considered to be determined by both spatial and logical importance. Spatial importance refers to whether a node is spatially important. If some nodes belong to key nodes on the walking path or have connecting edges with many other nodes, they are more easily accessed during random walks, indicating that these nodes are spatially important. Logical importance is a characteristic of locality and relativity between nodes. Simply put, when determining the logical importance of node B to node A, it depends on whether the preference weight from node A to another node B is relatively high compared to the other connecting nodes of node A. If it is relatively high, then node B has a higher logical importance to node A. The paper [32] mentions that  
Figure 1: The architecture of PreferSAGE-SCF. Firstly, we created a heterogeneous graph and a user similarity matrix using the data in the dataset, and then submitted them to PreferSAGE and SCF for calculation. After that, PreferSAGE used the graph structure to calculate the embeddings of nodes’ attributes, and calculated the top n items with the highest inner product based on the target user’s historical visited items; UserCF calculates the top n nearest neighbors based on user similarity and organizes the items that they have visited before. Finally, the results of the two parts are merged using a misaligned method SCF and obtain the final results. a biased random walk relies on user features, but it has the problem of dynamically setting the walk probability for each user during the walk, resulting in performance issues and a lack of suitability for this paper. The random walk in this paper is suitable for situations wherein there is no clear user preference. It calculates and sets the walk probability for an item node's relationship at one time, which can improve the final result without reducing learning efficiency. In the process of sampling neighboring nodes using random walks, logical importance is reflected when the current node determines the direction of the next walk, while spatial importance is reflected when an organized walk results. For each node (including item nodes and user nodes), the calculation formula for the probability of selecting the next node is shown in Formula (1):  
\[p_{next}^{(k)}=\frac{w_{item}^{(k)}}{\sum_{n\in N}w_{item}^{(n)}} \tag{1}\]  
Among them, \(p_{next}^{(k)}\) is the probability of the current node accessing neighboring node \(k\), \(w_{item}^{(k)}\) is the preference weight between the current node and node \(k\), and \(\sum_{n\in N}w_{item}^{(n)}\) is the sum of preference weights from the current node to each adjacent node. The formula for calculating preference weights in this paper's model is shown in Formula (2):  
\[w_{item}=\left\{ \begin{matrix}(\frac{s_{item}}{max(s_{item})})^{2},&s_{item} \geq B_{s}\\ 0,&s_{item}<B_{s}\end{matrix} \right. \tag{2}\]  
Among them, \(w_{item}\) is the current user's preference weight for a certain item.