Abstract
Matrix factorization (MF) models are effective and easy to expand and are widely used in industry, such as rating prediction and item recommendation. The basic MF model is relatively simple. In practical applications, side information such as attributes or implicit feedback is often combined to improve accuracy by modifying the model and optimizing the algorithm. In this paper, we propose an attribute interaction-aware matrix factorization (AIMF) method for recommendation tasks. We partition the original rating matrix into different sub-matrices according to the attribute interactions, train each sub-matrix independently, and merge all the latent vectors to generate the final score. Since the generated sub-matrices vary in size, an adaptive regularization coefficient optimization strategy and an adaptive latent vector dimension optimization strategy are proposed for sub-matrix training, and a variety of latent vector merging methods are put forward. The method AIMF has two advantages. When the original rating matrix is particularly large, the training time complexity of the MF-based model becomes higher and the update cost of the model is also higher. In AIMF, because each sub-matrix is usually much smaller than the original rating matrix, the training time complexity is greatly reduced after using parallel computing technology. Secondly, in AIMF, it is not necessary to modify the matrix factorization model to incorporate attributes and their interactive information into the model to improve the performance. The experimental results on the two classic public datasets MovieLens 1M and MovieLens 100k show that AIMF can not only effectively improve the accuracy of recommendation, but also make full use of parallel computing technology to improve training efficiency without modifying the matrix factorization model.
Introduction
Matrix factorization is an important method in machine learning and has been widely and effectively applied in the industry such as product recommendation on Amazon.com [1] and movie recommendation on Netflix.com [2]. It has also been continuously concerned in academia, resulting in a lot of related work such as feature learning and optimization algorithms [3, 4]. Although the mathematical representation of MF model is very concise, it is suitable for processing large-scale data, and the results have good interpretability. Moreover, it is easy to fuse a variety of side information and regularization to improve its accuracy [5, 6, 7, 8].
Matrix factorization (MF) is widely used for rating prediction and recommendation. Given a user-item matrix (also called rating matrix), as shown in the lower right section of Fig. 1 where a large number of rating data is unknown. The main idea is to factorize the original user-item matrix into the user matrix and item matrix. Each vector in the user/item matrix represents the behavior features of a user/item. By multiplying the user matrix with the item matrix we can obtain a new user-item matrix called predicted matrix, which fills the missing data in the original matrix.
An example of a rating prediction ecosystem. The lower right section is a sparse rating matrix where each ? denotes an unknown rating, the lower left section in blue background shows the attributes of users, the upper right section in green background shows the attributes of items, and the goal of rating prediction is to uncover these unknown ratings and recommend the items with high rating values to related users, which is shown in the upper left section.
The traditional MF algorithm only uses the rating data in the lower right section of Fig. 1 and the attribute information is not involved in the model training process. The fitting relationship between a user and all items is included in a unique latent vector, which can prevent over-fitting to a certain extent but lead to the lack of perception of attribute information.
Attribute awareness is a very important research direction in MF algorithm optimization [5, 7, 8]. The idea is to integrate the attribute information of users or items into the process of factorization by some methods. The related attribute awareness methods we have seen in previous papers can be divided into two categories, modifying the recommendation formula and optimizing the loss function. It should be noted that these methods only obtain attribute information but cannot discover the knowledge of attribute interactions. In Factorization Machines (FMs) model we can see the significant improvements brought about by the interactions between features [9]. Through comparative analysis, we believe that attributes and their interactions can also bring better results for MF model.
To mine the attributes and their interactions, we propose an attribute interaction aware matrix factorization (AIMF) method in this paper by referring to two concepts, interaction introduced in FMs and field introduced in field-aware factorization machines (FFMs) model [10, 11]. We propose to divide the original matrix into sub-matrices, train them independently, and then merge them for the final rating prediction. AIMF solves two issues: First, when the original rating matrix is very large, the time complexity of model training will become very high and the model update cost will also become higher. Generally, the size of the sub-matrix is much smaller than the original matrix, so the training time complexity of the sub-matrix will be greatly reduced. Second, in AIMF, the interaction information of attributes can be incorporated into the model without modifying the matrix factorization model. The main contributions of the paper include the following:
To the best of our knowledge, this work represents the first step towards absorbing attribute interaction information into matrix factorization learning without modifying the model of matrix factorization. The proposed AIMF method can improve recommendation performance and model training efficiency. The proposed AIMF provides insight into which feature interactions contribute more to the prediction at the field level. Two optimization schemes are developed to further improve both the performance of AIFM. A parallel processing technique is used to improve the efficiency of AIMF. The experimental results on two well-known datasets show the superiority of the proposed interaction-aware models over the state-of-the-art MF-based methods. The extensive experiments are conducted on two public datasets MovieLens 1M and MovieLens 100K because they contain user and item attribute data while most other public datasets do not contain relevant attribute information. Experimental results show that AIMF outperforms other classic MF based models.
In this section, we mainly introduce the concept of matrix factorization, the related improvement methods, and the analysis of their advantages and disadvantages.
The method of modifying recommendation model. Koren et al. mentioned that by converting attribute information into factor vectors and adding them to the prediction formula, the algorithm can obtain better effect [15]. The predicted score
where
where The method of modifying loss function. The optimized loss function can be also modified to include the attribute information. Ma et al. proposed a loss function which is expressed as [16]
where
Although these two kinds of methods can mine the attribute information of users and items, they cannot reflect the interaction information of attributes. In this paper, we propose a matrix factorization model, which not only utilizes the user and item attributes in the dataset, but also makes full use of the interaction information between them to improve the accuracy of the prediction. In the model, the attribute pairs mined from attributes and their interactions are used to guide the partitioning of the rating matrix. Each sub-matrix corresponds to a different attribute pair. Each sub-matrix can be independently trained, and their prediction results account for different proportions in the final prediction, which will help improve the efficiency of model learning and the accuracy of prediction, respectively.
Framework
Table 1 shows the description of all the notions to be used in the paper. The formal description of AIMF method is as follows. Suppose
Notation information
Notation information
The framework of AIMF approach. It consists of three parts, matrix partitioning, sub-matrices training, and latent vectors merging & rating prediction. The bottom is the original rating dataset.
Matrix partitioning. The original matrix Sub-matrices training. Each sub-matrix can be trained in parallel, and each matrix training can be optimized in different way. Since the sizes of sub-matrices are different, we will use different regularization coefficients and latent vector lengths to train these sub-matrices. The settings of these two hyperparameters will be explained in detail below. Latent vectors merging & rating prediction. Finally, we merge all the latent vectors, which represent different attribute interactions. In this paper, we also propose some latent vector merging methods.
There are three key problems to be solved in this framework. (1) How to get attribute interactions and how to choose attribute interaction set? This is the basis of matrix partitioning. (2) How to perform matrix factorization operations on matrices of different sizes? (3) How to merge the results of these sub-matrices factorization? The following will analyze these several issues.
The basis for matrix division is attribute interaction, such as age 24 and action movies. The acquisition of the interactive relationship is the premise of the accuracy of AIMF.
First, we preprocess user and item attribute values to obtain an appropriate number and high-quality attribute classification. Generally, the type of attribute value is text, and we use Word2Vec model to extract the characteristics of the attribute value and obtain the word vector. Considering the influence of the number of attribute values, we use Kmeans clustering algorithm to cluster these word vectors, the purpose of which is to select a suitable number of attribute-value categories. The number of attribute value classifications follows a normal distribution, and some of them are very small. At this time, these small number of attribute classifications are merged into the closest classification to avoid the problem of partial matrix data scarcity during subsequent matrix division.
Then, the attribute interaction relationship is obtained according to the attribute classification, and the matrix is divided. For example, if there are 8 user attribute categories, male and female,
Sub-matrices training and optimization
There are two important hyperparameters when training a basic MF model, regularization coefficients and hidden vector dimensions. In AIMF, multiple sub-matrices are generated after the original matrix is divided, and the sizes of the sub-matrices are different, so the settings of these two hyperparameters also need to be adjusted adaptively. Two optimization strategies for sub-matrix training are proposed below.
Optimization strategy of regularization coefficient
When a machine learning model is trained, regularization coefficients are used to limit the feature space, and its size is negatively correlated with the number of training data sets. A proper regularization coefficient can theoretically make the model get better results in training. In AIMF, the size of each sub-matrix is different, and sometimes the difference is particularly large. Assuming that the regularization coefficient used in the original MF is
where
where
[b] Matrix partitioning and sub-matrix training[1]
return subV;
ForkProcess_Run
Hidden vectors represent the characteristics of a user or product. The larger the dimension of a hidden vector, the richer the meaning of the features it can represent. At the same time, the larger the training data set, the more the value of the hidden vector obtained can reflect the true characteristics of the user or item. Some users and products in the rating matrix are relatively low in activity, while others are very high. If the same
The size of each sub-matrix in the AIMF model is different. In this paper, a
where
To improve model training efficiency, the usual way is to use parallel processing technology. The key to the traditional parallel matrix decomposition training is the data synchronization during processing. In AIMF method, the original matrix has been divided into several sub-matrices with smaller data volume. These sub-matrices can be trained in parallel, without interfering with each other during training, without the need to consider data synchronization.
In this paper, a stochastic gradient descent algorithm is used to train the sub-matrix factorization model. The latent vectors obtained by each sub-matrix factorization are stored separately and then combined. The specific process is shown in Algorithm 1.
Algorithm 1 contains 2 parts. The first part is matrix partitioning. After the first part is completed, all sub-matrices will be returned. The time complexity of the first part is
For the basic MF model, after the model training is completed, a hidden vector will be generated for each user and each product. By multiplying the hidden vector of user u and product
Latent vector merging refers to effectively combining multiple sets of hidden vectors obtained by sub-matrix training. In practical application, there will be a phenomenon: the size of some sub-matrices is relatively large and some are relatively small. The latent vectors generated by large-scale matrix training have a greater impact on the overall prediction performance, so the proportion of their ratings should be increased when merging.
Here we propose several different weight distribution methods for measuring three different prediction ratings, how to choose the most influential rating, how to strengthen the influential rating, and how to synthesize these ratings for prediction.
An instance of latent vectors merging.
Figure 3 illustrates the process of latent vectors merging and rating prediction through an example. Among them, user
Dist I: Average distribution method. it is the simplest merging method.
where Dist II: Distribution method based on user activity. In AIMF, the partitioning of sub-matrices is determined by attribute interactions and different attribute interactions show different levels of importance. If the interaction of a certain attribute is very important, then its corresponding hidden vector should be assigned a higher weight when combined. Therefore, how to measure the importance of attribute interaction is the key. Here, we assume that the higher the proportion of a user who rates an item in a sub-matrix or the more frequent the rating behavior, the more the user is interested in the attribute interaction. Conversely, if a user has few ratings in a sub-matrix, it means that this attribute interaction is not important to the user. In the combination of hidden vectors, the sub-matrix that the user pays more attention to can be set with a higher weight. Based on this idea, the distribution method based on user activity is defined as follows.
where Dist III: Distribution method based on item activity. Since how to measure the importance of attribute interaction is the key. Here, we assume that when an item gets a higher rating ratio in a sub-matrix, it indicates that the item is more popular for this attribute interaction, so we can set higher weight for its weight. Based on this idea, the distribution method based on item activity is defined as follows.
where Dist IV: Distribution method based on user and item activity. In this method, two factors of user activity and item activity are both considered.
Dist V: Further adjustment. In addition to the preferences of the user and the item itself, this method also takes into account the credibility of each attribute interaction matrix. For example, the greater the amount of data in an attribute interaction matrix, the higher the reliability of the latent vectors trained under the matrix, and the lower the reliability of the latent vectors trained by the matrix with the smaller amount of data.
where
After the weights are normalized, we can use them to calculate the prediction ratings, the formula is as follows.
In this section, we evaluate the performance of the proposed method AIMF on two real-world datasets and examine the effect of different parts of AIMF. We conduct experiments with the aim of answering the following questions.
RQ1 How do the different latent vectors merging methods impact AIMF? RQ2 How does the optimization of latent vectors dimension impact AIMF? RQ3 How does the optimization of regularization coefficient impact AIMF? RQ4 How does AIMF perform compared to other MF-based methods? RQ5 How does AIMF reduce the training time?
MF. The basic MF model is mainly used as a benchmark for comparison. SVD++. Based on the basic MF model, this model considers users historical rating records, so that it can learn the users latent interest preferences, and improve the performance without adding more training data. UMF. Based on the basic MF model, this model considers users attribute information. Equation (2) shows the rating prediction. IMF. Based on the basic MF model, this model considers items attribute information. Equation (3) shows the rating prediction. AIMF. It is the method proposed in this paper and no optimization is done on it. AIMF-1. It is based on AIMF and the strategy of adaptive regularization coefficient optimization is applied. AIMF-2. It is based on AIMF and the strategy of adaptive latent vector dimension optimization is applied.
Root Mean Square Error (RMSE) is defined as
where
Recommendation Hit Rate (HR) is divided into two types: not considering the order of recommendation (
where
Since users may rate the same value for multiple items, the computation of
Evaluation of merging methods (RQ1)
We compare and analyze the impact of different latent vector merging methods in AIMF based on RMSE, as shown in Table 2. Different merging methods show different performances, however, the trend of performance change is consistent. We rank the methods according to performance from high to low, and they are Dist V
Comparison of different latent vector merging methods
Comparison of different latent vector merging methods
To verify the effectiveness of the optimization strategy about latent vector dimension proposed in this paper, multiple sets of different values are set the hyperparameter
Comparison of different latent vector merging methods
Comparison of different latent vector merging methods
To verify the effectiveness of the regularization coefficient optimization strategy proposed in this paper, multiple sets of different regularization coefficients are set in this paper. By adjusting
Comparison of AIMF using different regularization coefficients
Comparison of AIMF using different regularization coefficients
As can be seen from Table 5, the performance of MF is the worst, and the performance of SVD++ has been improved because users implicit feedback information is combined in the model, and UMF and IMF obtain similar performance to SVD++ users attribute information and items attribute information are combined in the models respectively. From a subtle point of view, the effect of UMF is slightly better than IMF, because the users attribute information in the data set is more abundant than the items attribute information in these two datasets. The improvement of AIMF is higher than that of SVD++, UMF and IMF. The effects of AIMF-1 optimized by regularization coefficients and AIMF-2 optimized by hidden vector dimensions have been significantly improved. Among them, AIMF-2 performed best. Compared with AIMF-1, RMSE values of AIMF-2 on the two datasets were reduced by 0.24% and 0.22%, respective.
RMSE comparison of MF-based methods
RMSE comparison of MF-based methods
The metric of RMSE is mainly used to evaluate the overall effect of machine learning models while the metric of HR is more suitable for the actual needs of the recommender systems. Next, we will show the results of
Comparison of MF-based methods for hit ratio not considering recommendation order
It can be seen from Table 6 that as the length of the recommendation list increases, the value of
By comparing Tables 6 and 7, we can find that
In addition to the accuracy of the evaluation method, we also make statistics on the training time of each method. The specific values are shown in Table 8. From Table 8, we can see that compared to MF, the time spent in SVD++, UMF, and IMF training generally increases, because these methods require training additional hidden vector parameters. Although the AIMF method requires more training parameters than MF, AIMF can be performed in a parallel environment. In the experiment, each sub-matrix is assigned a parallel task, so the overall training time is determined by the sub-matrix with the longest training time. When the computing resources are sufficient and the amount of data between the sub-matrices is not much different, the parallel processing technique in this paper can help shorten the training time effectively. Compared with MF, the time consumption of AIMF on the two data sets is reduced by 65.11% and 53.44% respectively.
Comparison of MF-based methods for hit ratio considering recommendation order
Comparison of MF-based methods for hit ratio considering recommendation order
Training time comparison of different MF-based methods
To exploit the advantages of the user and item attributes for matrix factorization in rating prediction and recommendation tasks, in this paper we propose an attribute interaction-aware matrix factorization method AIMF. In this method, the original matrix is divided into multiple sub-matrices that are associated with particular attribute interactions, and these sub-matrices are separately trained and then the latent vectors generated by them are fused. This method can not only help discover the effect of attribute interaction on matrix decomposition to improve the performance of matrix factorization but also can use parallel processing to achieve efficient training. Experiments have verified that AIMF method obtains a good performance improvement by directly using the basic MF model. The existing MF optimization algorithms can also be applied to this method to further improve performance. Whether the existing optimization algorithm combined with this method can play a better effect, and how much effect can be improved need further study.
