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.
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 includes customers and commodities, represents the customer-commodity scoring matrix, which is shown as Figure 1. represents the rating of customer to item , where . Usually, there many empty elements in , and it will cause a sparse matrix of customer-commodity scoring.

In social networks, as shown in Figure 2, the social relationship between customers can be represented by a matrix : , the value of is 0 or 1, and if , it means that there is no social relationship between customers.

The flowchart of traditional matrix factorization algorithm [8] is shown in Figure 3.

Matrix can be factorized into user feature matrix and item feature , respectively. represents dimension of vector, in general, it is much smaller than and , and then dimensionality reduction can be realized. and represent the potential feature spaces of corresponding users and items , respectively. The null value in scoring matrix can be forecast through , and then the prediction scoring matrix could be obtained.
For the convenience of research, the function is used to map the customer’s scoring of the commodity to [0,1] interval, where represents the customer’s maximum scoring of commodity. The traditional matrix factorization only uses a simple linear model , 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 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 astwhere indicates that follows a Gaussian distribution whose mean is and variance is . represents an index function, and if user has a score of item , its value is 1; otherwise, it is 0. Suppose and obey the spherical Gaussian distribution prior to mean 0:
Then, through Bayesian inference, the posterior probability distribution of and could be obtained as follows:
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. represents an matrix, which factorizes the social network into user feature matrix and social feature matrix . The conditional distribution of observed social relationship can be defined:
Suppose that and follow the spherical Gaussian prior distribution with mean 0:
Then, through simple Bayesian inference, the following results can be obtained:where is an indicator function, and if user has a social relationship with user , its value is 1; otherwise, it is 0.
The flowchart of matrix factorization recommendation algorithm integrating a social relationship (MFRS1) is shown in Figure 4.

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:where 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:where is used to adjust the influence proportion of user scoring matrix and social relationship matrix on recommendation result. When , it means that the social relationship between users is not considered, when , it means that the user scoring matrix has a proportion of 0, and the rest means that a social relationship is integrated. , , , , 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 relationships and between users, and the flowchart of matrix factorization recommendation algorithm integrating multiple social relationships (MFRS2) is shown in Figure 5.

According to the algorithm, relationship between users is represented by matrix , and relationship between users is represented by matrix . If relationship strength of is , then relationship strength of is , where . Therefore, the objective function for minimizing the introduction of two kinds of social relationships is
The gradient descent algorithm can be used to solve the objective function as follows:where represents derivative of logistic function . For reducing model complexity, the corresponding parameter setting is .
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:where represents the real scoring of customer for commodity , represents the prediction scoring of customer for commodity , and represents the test set.
3.3. Experimental Results Analysis
During the experiment, the number of algorithm user features is , the number of iterations is 1000, and . 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. 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.


As shown in Figures 6 and 7, in the Epinions dataset, when , the values of MAE and RMSE are all the smallest; that is, for one social relationship, when , the recommendation accuracy rate is the highest.
and are used to denote the item sets that customers and had scored, respectively, the more commodities which customers and jointly scored, the more likely they are to have the same interest and influence each other, and the specific definitions are as follows:
When , it means that customers and have similar interests. Suppose that the relationship between users satisfying this condition is the relationship. When and take different values, the changes in MAE and RMSE on the Epinions dataset are shown in Figures 8 and 9.


As shown in Figures 8 and 9, in the Epinions dataset, when the parameters and , the value of MAE is the smallest, that is, the recommended accuracy rate in the proposed algorithm is the highest. Similarly, when and , 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.
As shown in Table 1, 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.
Data Availability
The basic data used in this article are downloaded from the online public dataset: Epinions http://www.trustlet.org/epinions.html.
Conflicts of Interest
The authors declare that there are no conflicts of interest regarding the publication of this paper.
Acknowledgments
This research was funded by the Shandong Provincial Natural Science Foundation, China, grant no. ZR2017MG011, and Humanity and Social Science Youth Foundation of Ministry of Education of China, grant no. 15YJC860001.