# Matrix Factorization Recommendation Algorithm Based on Multiple Social Relationships

Authors: Sheng Bin; Gengxin Sun
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

With the widespread use of social networks, social recommendation algorithms that add social relationships between users to recommender systems have been widely applied. Existing social recommendation algorithms only introduced one type of social relationship to the recommendation system, but in reality, there are often multiple social relationships among users. In this paper, a new matrix factorization recommendation algorithm combined with multiple social relationships is proposed. Through experiment results analysis on the Epinions dataset, the proposed matrix factorization recommendation algorithm has a significant improvement over the traditional and matrix factorization recommendation algorithms that integrate a single social relationship.


---

## Body

## 1. Introduction

With the development of big data technology, data redundancy has seriously interfered with obtaining effective information. The recommendation system solves the problem well and becomes a research hotspot in related fields. The recommendation system recommends items or information that may be of interest to users based on their hobbies, demand information, and consumer behavior [1, 2]. At present, the recommender system had been widely used in different industries, such as Amazon product recommendation, iTunes music recommendation, and Netflix movie recommendation because the recommendation algorithm can filter according to the mass of user history information, mine the deep relationship between users and users or items, and produce more accurate personalized recommendation with preference characteristics, which can better meet the needs of users. The algorithms used by the recommendation system consist of three types: collaborative filtering recommendation algorithms [3, 4], content-based recommendation algorithms [5], and hybrid recommendation algorithms [6]. Among them, collaborative filtering recommendation algorithm is currently the most popular, and it consists of three types: item-based collaborative filtering [7], user-based collaborative filtering [8], and matrix factorization collaborative filtering [9]. The matrix factorization collaborative filtering recommendation algorithm has attracted more and more researchers’ attention because of its outstanding performance in the Netflix Prize competition. However, in practical applications, only a small number of users will rate or comment on a small number of items. Therefore, the matrix factorization recommendation algorithm has obvious data sparsity problem and item cold-start problem. The algorithm expresses the user’s scorings of items in matrix form and factorizes the matrix to mine low-dimensional hidden feature space and then get user feature matrix and item feature matrix, finally through inner product operation of the two low-dimensional feature matrixes to describe the relation between users and items. Although the existing recommendation algorithms had obtained a good recommendation result, these traditional recommendation algorithms ignored the influence of social relationships among users on recommendation results. Since social relationships can reflect the similarity between users’ preferences, simply considering the user’s scoring of the items can no longer meet the recommendation needs, so the social recommendation algorithm that introduces social relationship into recommendation algorithm became current research hotspots in recommendation systems [10]. Hao et al. [11] proposed a weighted bipartite graph recommendation algorithm that used the monotonic saturation function as the weight and used the true value of the number of target users and other items to score relative to the total number of users as the traditional similarity coefficient. Chen et al. [12] calculated the similarity between users and items through similar tags and proposed a joint probability matrix factorization recommendation algorithm that merged the neighbor perception of social tags, effectively using the semantics of the tag improved the recommendation quality. Lin et al. [13] used the principle of trust generation in social psychology, based on the trust extension method of user credibility, to alleviate the sparseness of data, and proposed a matrix recommendation algorithm with enhanced trust. Korpinar et al. [14] based on the shared representation method of user feature matrix, proposed a novel social recommendation model based on shared representation of user feature matrix, which effectively improved the accuracy of recommendation.Most existing social recommendation algorithms only introduce a social relationship, but each added social relationship affects the recommendation result differently, so introduction of multiple social relationships would definitely improve recommendation accuracy. In this paper, a multiple relationships social network is constructed through a multi-subnet composite complex network model [15], a shared user feature matrix is used to introduce multiple social relationships into the recommendation algorithm, and a matrix factorization recommendation algorithm that integrates multiple social relationships is proposed.


## 2. Methodology

### 2.1. Traditional Matrix Factorization Model

Assuming that the recommendation system includesm customers and n commodities, Rm×n=Rijm×n represents the customer-commodity scoring matrix, which is shown as Figure 1. Rij represents the rating of customer i to item j, where Rij∈1,5. Usually, there many empty elements in Rm×n, and it will cause a sparse matrix of customer-commodity scoring.Figure 1
Customer-commodity scoring matrix.In social networks, as shown in Figure2, the social relationship between customers can be represented by a matrix C: C=Cikm×m, the value of Cik is 0 or 1, and if Cik=0, it means that there is no social relationship between customers.Figure 2
Customer social relationship matrix.The flowchart of traditional matrix factorization algorithm [8] is shown in Figure 3.Figure 3
Flowchart of probabilistic matrix factorization.MatrixRm×n can be factorized into user feature matrix Um×k and item feature Vk×n, respectively. k represents dimension of vector, in general, it is much smaller than m and n, and then dimensionality reduction can be realized. Ui and Vj represent the potential feature spaces of corresponding users ui and items vj, respectively. The null value in scoring matrix can be forecast through UiTVj, and then the prediction scoring matrix could be obtained.For the convenience of research, the functionfa=1/Rmax is used to map the customer’s scoring of the commodity to [0,1] interval, where Rmax represents the customer’s maximum scoring of commodity. The traditional matrix factorization only uses a simple linear model R=UTV, and the obtained results will be too fitted to the scoring matrix, resulting in the prediction scores deviating too much from the real data, and the final prediction results are distorted. Therefore, the logistic function ga=1/1+e−a is used in this paper, so that the customer’s scoring of commodity is defined in the range of [0, 1]. The observed conditional probability distribution can be defined ast(1)pR|U,V,σR2=∏i=1m∏j=1nNrij|gUiTVj,σR2IijR,where Nx|μ,σ2 indicates that x follows a Gaussian distribution whose mean is μ and variance is σ2. IijR represents an index function, and if user i has a score of item j, its value is 1; otherwise, it is 0. Suppose U and V obey the spherical Gaussian distribution prior to mean 0:(2)pU|σU2=∏i=1mNUi|0,σU2I,pV|σV2=∏j=1nNVj|0,σV2I.Then, through Bayesian inference, the posterior probability distribution ofU and V could be obtained as follows:(3)pU,V|R,σR2,σU2,σV2∝pR|U,V,σR2pU|σU2pV|σV2=σ∏i=1m∏j=1nNrij|gUiTVj,σR2IijR×∏i=1mNUi|0,σU2I×∏j=1nNVj|0,σV2I.


### 2.2. Matrix Factorization Recommendation Algorithm Integrating a Social Relationship

In the traditional recommendation algorithm, users are independent of each other, which ignores the users’ social relationship. If there is a social relationship between two users, the preferences of users or the choice of items will affect each other. Therefore, it is necessary to integrate social relationships into the recommendation algorithm; thus, recommendation accuracy will be improved greatly.Suppose that there is only one kind of social relationship between users, and the social relationship can be incorporated into the matrix factorization recommendation algorithm through sharing the user’s potential eigenspace, which is the same as that in user scoring matrix. Then, it is analyzed by probability matrix factorization.C=Cik represents an m×m matrix, which factorizes the social network into user feature matrix U∈Rl×m and social feature matrix Z∈Rl×m. The conditional distribution of observed social relationship can be defined:(4)pC|U,Z,σC2=∏i=1m∏k=1mNcik|gUiTZk,σC2IikC.Suppose thatU and Z follow the spherical Gaussian prior distribution with mean 0:(5)pU|σU2=∏i=1mNUi|0,σU2I,pZ|σV2=∏j=1nNZk|0,σZ2I.Then, through simple Bayesian inference, the following results can be obtained:(6)pU,Z|C,σC2,σU2,σZ2∝pC|U,Z,σC2pU|σU2pZ|σZ2=σ∏i=1m∏k=1mNcik|gUiTZk,σC2IikC×∏i=1mNUi|0,σU2I×∏k=1mNZk|0,σC2I,where IikC is an indicator function, and if user i has a social relationship with user k, its value is 1; otherwise, it is 0.The flowchart of matrix factorization recommendation algorithm integrating a social relationship (MFRS1) is shown in Figure4.Figure 4
Flowchart of matrix factorization recommendation algorithm integrating a social relationship.According to the shared user eigenspace, the user’s item scoring matrix is closely related to the social relationship matrix, and the posterior distribution of social recommendations can be obtained by logarithm:(7)lnpU,V,Z|C,R,σC2,σR2,σU2,σV2,σZ2=−12σR2∑i=1m∑j=1nIijRrij−gUiTVj2−12σC2∑i=1m∑k=1mIikCcik∗−gUiTZk2−12σU2∑i=1mUiTUi−12σV2∑j=1nVjTVj−12σZ2∑k=1mZkTZk−12∑i=1m∑j=1nIijRlnσR2+∑i=1m∑j=1nIijRlnσC2−12mllnσU2+nllnσV2+mllnσZ2+C,where C is a constant which does not rely on any parameter, and the maximum posterior distribution function should be equal to the minimum objective function, which is as follows:(8)ℒR,C1,C2,U,V,Z1,Z2=λC2∑i=1m∑j=1nIijRrij−gUiTVj2+1−λC2∑i=1m∑k=1mIikCCik∗−gUiTZk2+λU2UF2+λV2VF2+λZ2ZF2,where λC∈0,1 is used to adjust the influence proportion of user scoring matrix and social relationship matrix on recommendation result. When λC=1, it means that the social relationship between users is not considered, when λC=0, it means that the user scoring matrix has a proportion of 0, and the rest means that a social relationship is integrated. λC=σR2/σC2, λU=σR2/σU2, λV=σR2/σV2, λZ=σR2/σZ2, ⋅F2 represents regularization.


### 2.3. Matrix Factorization Recommendation Algorithm Integrating Multiple Social Relationships

In actual social networks, there are often more than one kind of social relationship between users, and each social relationship has a different impact on the recommendation, so introduction of a kind of social relationship would definitely affect recommendation accuracy. Suppose that there are two kinds of social relationshipsc1 and c2 between users, and the flowchart of matrix factorization recommendation algorithm integrating multiple social relationships (MFRS2) is shown in Figure 5.Figure 5
Flowchart of matrix factorization recommendation algorithm integrating multiple social relationships.According to the algorithm,c1 relationship between users is represented by matrix C1=Cik1m×m, and c2 relationship between users is represented by matrix C2=Cik2m×m. If relationship strength of c1 is β, then relationship strength of c2 is 1−β, where β∈0,1. Therefore, the objective function for minimizing the introduction of two kinds of social relationships is(9)ℒR,C1,C2,U,V,Z1,Z2=λC2∑i=1m∑j=1nIijRrij−gUiTVj2+β1−λC2∑i=1m∑k=1mIikC1Cik1∗−gUiTZk12+1−β1−λC2∑i=1m∑k=1mIikC2Cik2∗−gUiTZk22+λU2UF2+λV2VF2+λZ2ZF2.The gradient descent algorithm can be used to solve the objective function as follows:(10)∂ℒ∂Ui=λC∑j=1nIijRg′UiTVjgUiTVj−rijVj+β1−λC∑j=1mIikC1g′UiTZk1gUiTZk1−Cik1∗Zk1+1−β1−λC∑j=1mIikC2g′UiTZk2gUiTZk2−Cik2∗Zk2+λUUi,∂ℒ∂Vj=∑i=1mIijRg′UiTVjgUiTVj−rijUi+λVVj,∂ℒ∂Zk1=λC∑i=1mIikC1g′UiTZk1gUiTZk1−Cik1∗Ui+λZ1Zk1,∂ℒ∂Zk2=λC∑i=1mIikC2g′UiTZk2gUiTZk2−Cik2∗Ui+λZ2Zk2,where g′x=ex/1+ex2 represents derivative of logistic function gx. For reducing model complexity, the corresponding parameter setting is λU=λV=λZ1=λZ2.


## 2.1. Traditional Matrix Factorization Model

Assuming that the recommendation system includesm customers and n commodities, Rm×n=Rijm×n represents the customer-commodity scoring matrix, which is shown as Figure 1. Rij represents the rating of customer i to item j, where Rij∈1,5. Usually, there many empty elements in Rm×n, and it will cause a sparse matrix of customer-commodity scoring.Figure 1
Customer-commodity scoring matrix.In social networks, as shown in Figure2, the social relationship between customers can be represented by a matrix C: C=Cikm×m, the value of Cik is 0 or 1, and if Cik=0, it means that there is no social relationship between customers.Figure 2
Customer social relationship matrix.The flowchart of traditional matrix factorization algorithm [8] is shown in Figure 3.Figure 3
Flowchart of probabilistic matrix factorization.MatrixRm×n can be factorized into user feature matrix Um×k and item feature Vk×n, respectively. k represents dimension of vector, in general, it is much smaller than m and n, and then dimensionality reduction can be realized. Ui and Vj represent the potential feature spaces of corresponding users ui and items vj, respectively. The null value in scoring matrix can be forecast through UiTVj, and then the prediction scoring matrix could be obtained.For the convenience of research, the functionfa=1/Rmax is used to map the customer’s scoring of the commodity to [0,1] interval, where Rmax represents the customer’s maximum scoring of commodity. The traditional matrix factorization only uses a simple linear model R=UTV, and the obtained results will be too fitted to the scoring matrix, resulting in the prediction scores deviating too much from the real data, and the final prediction results are distorted. Therefore, the logistic function ga=1/1+e−a is used in this paper, so that the customer’s scoring of commodity is defined in the range of [0, 1]. The observed conditional probability distribution can be defined ast(1)pR|U,V,σR2=∏i=1m∏j=1nNrij|gUiTVj,σR2IijR,where Nx|μ,σ2 indicates that x follows a Gaussian distribution whose mean is μ and variance is σ2. IijR represents an index function, and if user i has a score of item j, its value is 1; otherwise, it is 0. Suppose U and V obey the spherical Gaussian distribution prior to mean 0:(2)pU|σU2=∏i=1mNUi|0,σU2I,pV|σV2=∏j=1nNVj|0,σV2I.Then, through Bayesian inference, the posterior probability distribution ofU and V could be obtained as follows:(3)pU,V|R,σR2,σU2,σV2∝pR|U,V,σR2pU|σU2pV|σV2=σ∏i=1m∏j=1nNrij|gUiTVj,σR2IijR×∏i=1mNUi|0,σU2I×∏j=1nNVj|0,σV2I.


## 2.2. Matrix Factorization Recommendation Algorithm Integrating a Social Relationship

In the traditional recommendation algorithm, users are independent of each other, which ignores the users’ social relationship. If there is a social relationship between two users, the preferences of users or the choice of items will affect each other. Therefore, it is necessary to integrate social relationships into the recommendation algorithm; thus, recommendation accuracy will be improved greatly.Suppose that there is only one kind of social relationship between users, and the social relationship can be incorporated into the matrix factorization recommendation algorithm through sharing the user’s potential eigenspace, which is the same as that in user scoring matrix. Then, it is analyzed by probability matrix factorization.C=Cik represents an m×m matrix, which factorizes the social network into user feature matrix U∈Rl×m and social feature matrix Z∈Rl×m. The conditional distribution of observed social relationship can be defined:(4)pC|U,Z,σC2=∏i=1m∏k=1mNcik|gUiTZk,σC2IikC.Suppose thatU and Z follow the spherical Gaussian prior distribution with mean 0:(5)pU|σU2=∏i=1mNUi|0,σU2I,pZ|σV2=∏j=1nNZk|0,σZ2I.Then, through simple Bayesian inference, the following results can be obtained:(6)pU,Z|C,σC2,σU2,σZ2∝pC|U,Z,σC2pU|σU2pZ|σZ2=σ∏i=1m∏k=1mNcik|gUiTZk,σC2IikC×∏i=1mNUi|0,σU2I×∏k=1mNZk|0,σC2I,where IikC is an indicator function, and if user i has a social relationship with user k, its value is 1; otherwise, it is 0.The flowchart of matrix factorization recommendation algorithm integrating a social relationship (MFRS1) is shown in Figure4.Figure 4
Flowchart of matrix factorization recommendation algorithm integrating a social relationship.According to the shared user eigenspace, the user’s item scoring matrix is closely related to the social relationship matrix, and the posterior distribution of social recommendations can be obtained by logarithm:(7)lnpU,V,Z|C,R,σC2,σR2,σU2,σV2,σZ2=−12σR2∑i=1m∑j=1nIijRrij−gUiTVj2−12σC2∑i=1m∑k=1mIikCcik∗−gUiTZk2−12σU2∑i=1mUiTUi−12σV2∑j=1nVjTVj−12σZ2∑k=1mZkTZk−12∑i=1m∑j=1nIijRlnσR2+∑i=1m∑j=1nIijRlnσC2−12mllnσU2+nllnσV2+mllnσZ2+C,where C is a constant which does not rely on any parameter, and the maximum posterior distribution function should be equal to the minimum objective function, which is as follows:(8)ℒR,C1,C2,U,V,Z1,Z2=λC2∑i=1m∑j=1nIijRrij−gUiTVj2+1−λC2∑i=1m∑k=1mIikCCik∗−gUiTZk2+λU2UF2+λV2VF2+λZ2ZF2,where λC∈0,1 is used to adjust the influence proportion of user scoring matrix and social relationship matrix on recommendation result. When λC=1, it means that the social relationship between users is not considered, when λC=0, it means that the user scoring matrix has a proportion of 0, and the rest means that a social relationship is integrated. λC=σR2/σC2, λU=σR2/σU2, λV=σR2/σV2, λZ=σR2/σZ2, ⋅F2 represents regularization.


## 2.3. Matrix Factorization Recommendation Algorithm Integrating Multiple Social Relationships

In actual social networks, there are often more than one kind of social relationship between users, and each social relationship has a different impact on the recommendation, so introduction of a kind of social relationship would definitely affect recommendation accuracy. Suppose that there are two kinds of social relationshipsc1 and c2 between users, and the flowchart of matrix factorization recommendation algorithm integrating multiple social relationships (MFRS2) is shown in Figure 5.Figure 5
Flowchart of matrix factorization recommendation algorithm integrating multiple social relationships.According to the algorithm,c1 relationship between users is represented by matrix C1=Cik1m×m, and c2 relationship between users is represented by matrix C2=Cik2m×m. If relationship strength of c1 is β, then relationship strength of c2 is 1−β, where β∈0,1. Therefore, the objective function for minimizing the introduction of two kinds of social relationships is(9)ℒR,C1,C2,U,V,Z1,Z2=λC2∑i=1m∑j=1nIijRrij−gUiTVj2+β1−λC2∑i=1m∑k=1mIikC1Cik1∗−gUiTZk12+1−β1−λC2∑i=1m∑k=1mIikC2Cik2∗−gUiTZk22+λU2UF2+λV2VF2+λZ2ZF2.The gradient descent algorithm can be used to solve the objective function as follows:(10)∂ℒ∂Ui=λC∑j=1nIijRg′UiTVjgUiTVj−rijVj+β1−λC∑j=1mIikC1g′UiTZk1gUiTZk1−Cik1∗Zk1+1−β1−λC∑j=1mIikC2g′UiTZk2gUiTZk2−Cik2∗Zk2+λUUi,∂ℒ∂Vj=∑i=1mIijRg′UiTVjgUiTVj−rijUi+λVVj,∂ℒ∂Zk1=λC∑i=1mIikC1g′UiTZk1gUiTZk1−Cik1∗Ui+λZ1Zk1,∂ℒ∂Zk2=λC∑i=1mIikC2g′UiTZk2gUiTZk2−Cik2∗Ui+λZ2Zk2,where g′x=ex/1+ex2 represents derivative of logistic function gx. For reducing model complexity, the corresponding parameter setting is λU=λV=λZ1=λZ2.


## 3. Results and Analysis

### 3.1. Experimental Data

In this paper, Epinions is used as the experimental dataset, and it is a knowledge-sharing website where customers could review commodities or give integer scorings between one and five. New customers can use these comments or ratings to determine whether the commodity is worth buying. The Epinions dataset includes the customer’s trust relationship, customer’s scoring for commodities, and comment information of commodities. It includes 49,290 customers, 139,738 commodities, 664,824 comment messages, and 487,181 trust relationships.In the course of experiment, a five-fold cross-validation method was used to train and verify the proposed recommended algorithm. The Epinions dataset was separated into five equal groups, one group was randomly selected as test set, and the other four groups were acted as training set. Five experiments were conducted to ensure that each test set is tested. The ultimate experimental result was the average of five experiments.


### 3.2. Evaluation Indicators

In this paper, two identical evaluation indicators are used to measure the accuracy of recommendations, namely, mean absolute error (MAE) and root mean squared error (RMSE) [16]. These two indicators measure accuracy of recommendation algorithm through calculating the error between the prediction score and the actual score. The smaller their value, the higher the recommendation accuracy. The definitions of MAE and RMSE are as follows:(11)MAE=1EP∑i,j∈EPrij−rij′,RMSE=1EP∑i,j∈EPrij−rij′2,where rij represents the real scoring of customer i for commodity j, rij′ represents the prediction scoring of customer ui for commodity j, and EP represents the test set.


### 3.3. Experimental Results Analysis

During the experiment, the number of algorithm user features isK=5, the number of iterations is 1000, and λU=λV=0.001. The proportion between social relationship matrix and customer scoring matrix can be adjusted by parameter α, and the proportion between the two social relationships can be adjusted by parameter β. The different values of α and β will directly affect the recommendation result. The value of α and β is determined by the method of simulation experiment. β=1 means that only one kind of social relationship is introduced, when α takes different values, and the change of MAE value and RMSE value in the dataset is shown in Figures 6 and 7.Figure 6
Influence of parameterα for MAE.Figure 7
Influence of parameterα for RMSE.As shown in Figures6 and 7, in the Epinions dataset, when α=0.8, the values of MAE and RMSE are all the smallest; that is, for one social relationship, when α=0.8, the recommendation accuracy rate is the highest.Ou and Ov are used to denote the item sets that customers u and v had scored, respectively, the more commodities which customers u and v jointly scored, the more likely they are to have the same interest and influence each other, and the specific definitions are as follows:(12)fuv=Ou∩OvOu∪Ov.Whenfuv>0.2, it means that customers u and v have similar interests. Suppose that the relationship between users satisfying this condition is the c2 relationship. When α and β take different values, the changes in MAE and RMSE on the Epinions dataset are shown in Figures 8 and 9.Figure 8
Influence of parameterα and β for MAE.Figure 9
Influence of parameterα and β for RMSE.As shown in Figures8 and 9, in the Epinions dataset, when the parameters α=0.3 and β=0.4, the value of MAE is the smallest, that is, the recommended accuracy rate in the proposed algorithm is the highest. Similarly, when α=0.7 and β=0.5, the value of RMSE is the smallest, which means that the recommendation accuracy in the proposed algorithm is the highest.For verifying the performance of MDRS2 algorithm and the impact of various social relationships on the recommendation, we compared MDRS2 algorithm with SocRec algorithm [14], TDSRec algorithm [17], and MDRS1 algorithm on the Epinions dataset. The SocRec algorithm considers the attributes of social relationships between users on the basis of matrix factorization and incorporates a social relationship; the TDSRec algorithm combines the similarity based on user ratings preferences while considering social networks and predicts the values of customer scoring matrix together. The MDRS1 algorithm only considers one kind of social relationship. The MDRS2 algorithm tightly links the user-item scoring matrix and the social relationship matrix through sharing the user’s feature space and integrates multiple social relationships into matrix factorization. The experimental statistical result is shown in Table 1.Table 1
Experiment result comparison of various algorithms.
Evaluation indexSocRecTDSRecMDRS1MDRS2MAE0.89320.78640.44510.4394RMSE0.92400.86790.61430.5973As shown in Table1, in the Epinions dataset, the MAE and RMSE values of the MDRS2 algorithm are smaller than those of other algorithms; that is, the prediction accuracy is higher. It can be seen that the recommendation algorithm that introduces two kinds of social relationships has a higher accuracy rate than other three recommendation algorithms, which indicates that introducing multiple relationships between users would improve recommendation accuracy, and the more relationships between users, the higher the recommendation accuracy.


## 3.1. Experimental Data

In this paper, Epinions is used as the experimental dataset, and it is a knowledge-sharing website where customers could review commodities or give integer scorings between one and five. New customers can use these comments or ratings to determine whether the commodity is worth buying. The Epinions dataset includes the customer’s trust relationship, customer’s scoring for commodities, and comment information of commodities. It includes 49,290 customers, 139,738 commodities, 664,824 comment messages, and 487,181 trust relationships.In the course of experiment, a five-fold cross-validation method was used to train and verify the proposed recommended algorithm. The Epinions dataset was separated into five equal groups, one group was randomly selected as test set, and the other four groups were acted as training set. Five experiments were conducted to ensure that each test set is tested. The ultimate experimental result was the average of five experiments.


## 3.2. Evaluation Indicators

In this paper, two identical evaluation indicators are used to measure the accuracy of recommendations, namely, mean absolute error (MAE) and root mean squared error (RMSE) [16]. These two indicators measure accuracy of recommendation algorithm through calculating the error between the prediction score and the actual score. The smaller their value, the higher the recommendation accuracy. The definitions of MAE and RMSE are as follows:(11)MAE=1EP∑i,j∈EPrij−rij′,RMSE=1EP∑i,j∈EPrij−rij′2,where rij represents the real scoring of customer i for commodity j, rij′ represents the prediction scoring of customer ui for commodity j, and EP represents the test set.


## 3.3. Experimental Results Analysis

During the experiment, the number of algorithm user features isK=5, the number of iterations is 1000, and λU=λV=0.001. The proportion between social relationship matrix and customer scoring matrix can be adjusted by parameter α, and the proportion between the two social relationships can be adjusted by parameter β. The different values of α and β will directly affect the recommendation result. The value of α and β is determined by the method of simulation experiment. β=1 means that only one kind of social relationship is introduced, when α takes different values, and the change of MAE value and RMSE value in the dataset is shown in Figures 6 and 7.Figure 6
Influence of parameterα for MAE.Figure 7
Influence of parameterα for RMSE.As shown in Figures6 and 7, in the Epinions dataset, when α=0.8, the values of MAE and RMSE are all the smallest; that is, for one social relationship, when α=0.8, the recommendation accuracy rate is the highest.Ou and Ov are used to denote the item sets that customers u and v had scored, respectively, the more commodities which customers u and v jointly scored, the more likely they are to have the same interest and influence each other, and the specific definitions are as follows:(12)fuv=Ou∩OvOu∪Ov.Whenfuv>0.2, it means that customers u and v have similar interests. Suppose that the relationship between users satisfying this condition is the c2 relationship. When α and β take different values, the changes in MAE and RMSE on the Epinions dataset are shown in Figures 8 and 9.Figure 8
Influence of parameterα and β for MAE.Figure 9
Influence of parameterα and β for RMSE.As shown in Figures8 and 9, in the Epinions dataset, when the parameters α=0.3 and β=0.4, the value of MAE is the smallest, that is, the recommended accuracy rate in the proposed algorithm is the highest. Similarly, when α=0.7 and β=0.5, the value of RMSE is the smallest, which means that the recommendation accuracy in the proposed algorithm is the highest.For verifying the performance of MDRS2 algorithm and the impact of various social relationships on the recommendation, we compared MDRS2 algorithm with SocRec algorithm [14], TDSRec algorithm [17], and MDRS1 algorithm on the Epinions dataset. The SocRec algorithm considers the attributes of social relationships between users on the basis of matrix factorization and incorporates a social relationship; the TDSRec algorithm combines the similarity based on user ratings preferences while considering social networks and predicts the values of customer scoring matrix together. The MDRS1 algorithm only considers one kind of social relationship. The MDRS2 algorithm tightly links the user-item scoring matrix and the social relationship matrix through sharing the user’s feature space and integrates multiple social relationships into matrix factorization. The experimental statistical result is shown in Table 1.Table 1
Experiment result comparison of various algorithms.
Evaluation indexSocRecTDSRecMDRS1MDRS2MAE0.89320.78640.44510.4394RMSE0.92400.86790.61430.5973As shown in Table1, in the Epinions dataset, the MAE and RMSE values of the MDRS2 algorithm are smaller than those of other algorithms; that is, the prediction accuracy is higher. It can be seen that the recommendation algorithm that introduces two kinds of social relationships has a higher accuracy rate than other three recommendation algorithms, which indicates that introducing multiple relationships between users would improve recommendation accuracy, and the more relationships between users, the higher the recommendation accuracy.


## 4. Conclusions

In this paper, through factorizing the user-item scoring matrix, according to multi-subnet composite complex network, a variety of social relationships are integrated into the matrix factorization recommendation algorithm by using the shared user’s potential feature space. Using the matrix factorization recommendation algorithm to the user-item dataset after introducing the social relationship, users’ preferences for items will be accurately obtained. Through experiments on real datasets, it is proved that the proposed matrix factorization recommendation algorithm, which combines multiple relationships, improves the recommendation accuracy. It means that introducing multiple social relationships can better personalize recommendations for users, and the more relationships introduced, the better the recommendation effect. In future research, the user’s indirect relationship and direct relationship can be combined to further study the impact of social relationships on recommendations.



---

*Source: 6610645-2021-02-26.xml*