## 2 Correlation Algorithm  
### User-Based Collaborative Filtering Recommendation  
User-based collaborative filtering is a prevalent recommendation algorithm within the field of recommender systems. This approach aims to predict items of potential interest to a user by leveraging the historical behaviors and preferences of other users who exhibit similar interests. The fundamental principle revolves around the notion that if two users have demonstrated similar preferences or purchases for items in the past, they are likely to share similar preferences for other items in the future [16].  
The algorithm entails the following key steps:  
1. Construction of User-Item Matrix The establishment of a rating matrix can be initiated through the historical ratings provided by users. Assuming a set of users as \(U=\{u_{1},\,u_{2},\,\ldots,\,u_{m}\}\), and a set of items as \(I=\{i_{1},\,i_{2},\,\ldots,\,i_{n}\}\), the rating matrix is denoted as \(R_{m,n}\), as illustrated in Equation (1), where \(r_{ij}\) represents the rating given by customer \(i\) to item \(j\). \[R_{m,n}=\begin{bmatrix}r_{1,1}&r_{1,2}&\cdots&r_{1,j}&\cdots&r_{1,n}\\ r_{2,1}&r_{2,2}&\cdots&r_{2,j}&\cdots&r_{2,n}\\ \vdots&\vdots&&\vdots&&\vdots\\ r_{i,1}&r_{i,2}&\cdots&r_{i,j}&\cdots&r_{i,n}\\ \vdots&\vdots&&\vdots&&\vdots\\ r_{m,1}&r_{m,2}&\cdots&r_{m,j}&\cdots&r_{m,n}\\ \end{bmatrix}\] (1)
2. Calculation of User Similarity The user-based collaborative filtering (U-CF) approach recommends items among users with similar historical ratings by analyzing the extent of their similarity. It employs the Pearson correlation coefficient as the metric for assessing similarity, which is used to delineate the likeness between users. Let \(r_{u}\) denote the rating vector of user \(u\), defined as \(r_{u}=\{r_{u,1},\,r_{u,2},\,\ldots,\,r_{u,n}\}\). The Pearson correlation coefficient between users \(u\) and \(v\) is depicted by Equation (2): \[sim(u,v)=\frac{\sum\limits_{i\in S}{(r_{u,i}-\overline{r}_{u})(r_{v,i}- \overline{r}_{v})}}{\sqrt{\sum\limits_{i\in S}{(r_{u,i}-\overline{r}_{u})}^{2 }}\sqrt{\sum\limits_{i\in S}{(r_{v,i}-\overline{r}_{v})}^{2}}}\] (2) where \(S\) represents the set of items for which both users \(u\) and \(v\) have given ratings. The variables \(r_{u,i}\) and \(r_{v,i}\), respectively, denote the ratings provided by users \(u\) and \(v\) for item \(i\), while \(\overline{r}_{u}\) and \(\overline{r}_{v}\) indicate the average ratings given by users \(u\) and \(v\). (3) Identifying Nearest Neighbors For the target user, calculate the similarity with other users using Equation (2), and subsequently select users with higher similarity scores as the nearest neighbors. (4) Predict Ratings and Generate RecommendationsCompute the final predicted ratings based on the nearest neighbors and the target user's ratings, and generate recommendations according to the obtained predicted ratings. The formula for calculating predicted ratings is as follows:  
\[P_{u,i}=\overline{r}_{u}+\frac{\sum\limits_{n\in N_{u}}sim(u,n)\times(r_{n,u}- \overline{r}_{n})}{\sum\limits_{n\in N_{u}}sim(u,n)} \tag{3}\]  
where \(N_{u}\) denotes the nearest neighbors of user \(u\), \(\overline{r}_{u}\) represents the rating mean of user \(u\), and \(r_{n}\) signifies the rating mean of the nearest neighbors of user \(u\).