Project recommendation method, device, electronic device and storage medium
The spectral graph wavelet collaborative filtering method addresses the limitations of polynomial-based approaches by using Haar wavelets to enhance feature learning, improving the accuracy of item recommendations by capturing complex user-item interactions.
Patent Information
- Application Number
- CN202410634677.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-05-21
AI Technical Summary
Existing collaborative filtering methods based on graph models struggle to accurately recommend items that users are truly interested in due to limitations in polynomial-based spectral domain approaches, which fail to capture complex interactive information and focus on signals of a certain frequency.
A spectral graph wavelet collaborative filtering method is introduced, utilizing Haar wavelets to construct a spectral filter function and train a model that captures more scale information, enabling richer feature learning of user-item interactions.
The method improves the accuracy of recommending items users are interested in by effectively learning interaction preferences through wavelet transforms, enhancing the model's ability to fit spectrum signals of any frequency.
Smart Images

Figure CN118427455B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a project recommendation method, device, electronic device and storage medium. Background Art
[0002] Collaborative filtering is a widely used technology in recommendation algorithms. It aims to learn features from explicit and implicit feedback between users and items, and then predict users' preferences for items. Among them, "explicit feedback" can be users' ratings and comments on items, etc.; "implicit feedback" can be users' clicks and browsing of items, etc. This collaborative filtering method is easy to expand, can better handle user historical behavior, and can give accurate recommendation results in a short time.
[0003] In the related art, the collaborative filtering method based on the graph model mainly mines the interactive information in the "user-item graph" by designing graph filters, and the current graph models mostly use polynomial-based methods. For example, the core of the graph collaborative filtering method based on the spectral domain is to perform graph Fourier transform through an orthogonal polynomial basis to learn the spectral signal of the graph. Although this method can filter out complex interactive information, usually only the first few orders of the polynomial are effective, and it cannot fit any filter due to the limitation of the polynomial basis. Therefore, the graph collaborative filtering method based on the spectral domain usually focuses on the signal of a certain frequency, and the learned graph frequency signal is relatively simple, that is, it cannot accurately learn the interactive preferences between users and items, which makes it difficult to accurately recommend items that users are really interested in. Summary of the invention
[0004] The present disclosure provides an item recommendation method, device, electronic device and storage medium to at least solve the problem in the above-mentioned related technologies that it is difficult to accurately recommend items that the user is truly interested in to the user.
[0005] According to a first aspect of an embodiment of the present disclosure, a project recommendation method is provided, comprising: obtaining historical interaction information between a user and a project; based on the historical interaction information, calculating a normalized Laplace matrix reflecting the interaction relationship between the user and the project; calculating the sum of the products of the learnable coefficient and the Haar wavelet at each scale in a preset plurality of scales as a spectral filter function; using the spectral filter function to filter the normalized Laplace matrix to obtain a graph wavelet basis; based on a preset initial input matrix, training a spectral graph wavelet collaborative filtering model, wherein the spectral graph wavelet collaborative filtering model is constructed by using the graph wavelet basis as a graph convolution propagation matrix of the spectral graph wavelet collaborative filtering model, the preset initial input matrix comprising an initial eigenvector of the user and an initial eigenvector of the project; based on the spectral graph wavelet collaborative filtering model obtained after the training is completed, recommending to the user projects that have not interacted with the user.
[0006] Optionally, the calculating of the sum of products of the learnable coefficients at each scale in the preset multiple scales and the Haar wavelet as a spectral filter function includes:
[0007] The spectral filter function is constructed by the following formula:
[0008]
[0009]
[0010] in, is the spectral filter function, is the Haar wavelet, is the scaling parameter, is the translation parameter, is the maximum scale among the preset multiple scales, is the eigenvalue variable, is the learnable coefficient, is the learnable coefficient exist =0~ = The collection in range, for exist =0~ = A collection within the scope.
[0011] Optionally, filtering the normalized Laplace matrix using the spectral filter function to obtain a graph wavelet basis includes:
[0012] Based on the normalized Laplace matrix, obtaining an eigenvector of the normalized Laplace matrix and an eigenvalue of the normalized Laplace matrix;
[0013] The eigenvalues of the normalized Laplace matrix are filtered using the spectral filter function through the following formula to obtain the graph wavelet basis:
[0014]
[0015] in, is the wavelet basis of the graph, is the eigenvector of the normalized Laplacian matrix, The eigenvalues of the normalized Laplacian matrix.
[0016] Optionally, the training of the spectral wavelet collaborative filtering model based on a preset initial input matrix includes: training the spectral wavelet collaborative filtering model in an iterative manner; wherein, for each iteration process, the following operations are performed: obtaining the input matrix at the beginning of this iteration; calculating the output matrix of this iteration based on the input matrix at the beginning of this iteration and the graph wavelet basis; calculating the value of the loss function based on the input matrix and output matrix of this iteration; and adjusting the , and use the output matrix of this iteration as the input matrix at the beginning of the next iteration of this iteration, wherein the input matrix at the beginning of the first iteration is the preset initial input matrix.
[0017] Optionally, the calculating the output matrix of this iteration based on the input matrix at the beginning of this iteration and the graph wavelet basis includes:
[0018] The output matrix of this iteration is calculated by the following formula:
[0019]
[0020]
[0021] in, is the output matrix of this iteration, is the number of layers contained in the spectral wavelet collaborative filtering model, is the output matrix of the qth layer of the spectral wavelet collaborative filtering model, is the output matrix of the (q-1)th layer of the spectral wavelet collaborative filtering model. is the input matrix at the beginning of this iteration.
[0022] Optionally, the loss function is expressed by the following formula:
[0023]
[0024] in, is the loss function, is the set of users, is a set of overlapping items, and the items included in the overlapping set are related to the user and items that other users have interacted with. The output matrix contains the users The inner product between the eigenvector of and the eigenvector of item i contained in the output matrix, The output matrix contains the users The eigenvectors of the output matrix contain the items The inner product between the eigenvectors of is the input matrix of this iteration, To control the coefficient of the L2 regularization term, is the Sigmoid function.
[0025] Optionally, a condition for terminating the iteration is that the number of iterations reaches a preset number.
[0026] Optionally, the training includes multiple rounds of training, and the recommending to the user the items among the items with which the user has not interacted based on the spectral wavelet collaborative filtering model obtained after the training is completed includes: for each round of training in the multiple rounds of training, calculating the inner product of the feature vector of the user and the feature vector of the item contained in the output matrix of the spectral wavelet collaborative filtering model in each round of training to obtain multiple inner products; selecting from the multiple inner products a target inner product whose size ranks in the top z and whose corresponding user has not interacted with the corresponding item, wherein z is an integer, and z 1; calculating the recall rate and / or normalized discounted cumulative gain of the target inner product; determining the target training round with the largest recall rate and / or the largest normalized discounted cumulative gain among the multiple rounds of training; and recommending the item indicated by the target inner product to the user indicated by the target inner product corresponding to the target training round.
[0027] Optionally, the calculating, based on the historical interaction information, a normalized Laplace matrix reflecting the interaction relationship between the user and the item includes:
[0028] Based on the historical interaction information between the user and the project, an interaction matrix is obtained, where if the i-th user and the j-th project have an interaction, the elements contained in the interaction matrix are ;otherwise, ;
[0029] Based on the interaction matrix, calculate the adjacency matrix:
[0030]
[0031] in, is the adjacency matrix, is the interaction matrix, is the transposed matrix of the interaction matrix;
[0032] Calculate the degree matrix of the interaction graph between the user and the project, wherein the interaction graph between the user and the project includes user nodes and project nodes, and if there is interaction between the user and the project, there is an edge between the user node corresponding to the user and the project node corresponding to the project;
[0033] Based on the adjacency matrix and the degree matrix, calculate the normalized adjacency matrix:
[0034]
[0035] in, is the normalized adjacency matrix, and D is the degree matrix;
[0036] Based on the normalized adjacency matrix, the normalized Laplace matrix is calculated:
[0037]
[0038] Among them, I is the project set.
[0039] According to a second aspect of an embodiment of the present disclosure, there is provided a project recommendation device, comprising: an interaction information acquisition module, configured to acquire historical interaction information between a user and a project; a normalized Laplace matrix calculation module, configured to calculate a normalized Laplace matrix reflecting the interaction relationship between the user and the project based on the historical interaction information; a spectral filter function calculation module, configured to calculate the sum of the products of the learnable coefficient and the Haar wavelet at each scale in a plurality of preset scales as a spectral filter function; a filtering module, configured to filter the normalized Laplace matrix using the spectral filter function to obtain a graph wavelet basis; a training module, configured to train a spectral graph wavelet collaborative filtering model based on a preset initial input matrix, wherein the spectral graph wavelet collaborative filtering model is constructed by using the graph wavelet basis as a graph convolution propagation matrix of the spectral graph wavelet collaborative filtering model, and the preset initial input matrix includes an initial eigenvector of the user and an initial eigenvector of the project; and a project recommendation module, configured to recommend to the user projects in the project that have not interacted with the user based on the spectral graph wavelet collaborative filtering model obtained after the training is completed.
[0040] Optionally, the spectral filter function calculation module is configured as:
[0041] The spectral filter function is constructed by the following formula:
[0042]
[0043]
[0044] in, is the spectral filter function, is the Haar wavelet, is the scaling parameter, is the translation parameter, is the maximum scale among the preset multiple scales, is the eigenvalue variable, is the learnable coefficient, is the learnable coefficient exist =0~ = The collection in range, for exist =0~ = A collection within the scope.
[0045] Optionally, the filtering module is configured to:
[0046] Based on the normalized Laplace matrix, obtaining an eigenvector of the normalized Laplace matrix and an eigenvalue of the normalized Laplace matrix;
[0047] The eigenvalues of the normalized Laplace matrix are filtered using the spectral filter function through the following formula to obtain the graph wavelet basis:
[0048]
[0049] in, is the wavelet basis of the graph, is the eigenvector of the normalized Laplacian matrix, The eigenvalues of the normalized Laplacian matrix.
[0050] Optionally, the training module is configured to: train the spectral wavelet collaborative filtering model in an iterative manner; wherein, for each iteration process, the following operations are performed: obtaining the input matrix at the beginning of this iteration; calculating the output matrix of this iteration based on the input matrix at the beginning of this iteration and the graph wavelet basis; calculating the value of the loss function based on the input matrix and output matrix of this iteration; adjusting the , and use the output matrix of this iteration as the input matrix at the beginning of the next iteration of this iteration, wherein the input matrix at the beginning of the first iteration is the preset initial input matrix.
[0051] Optionally, the training module is configured to:
[0052] The output matrix of this iteration is calculated by the following formula:
[0053]
[0054]
[0055] in, is the output matrix of this iteration, is the number of layers contained in the spectral wavelet collaborative filtering model, is the output matrix of the qth layer of the spectral wavelet collaborative filtering model, is the output matrix of the (q-1)th layer of the spectral wavelet collaborative filtering model. is the input matrix at the beginning of this iteration.
[0056] Optionally, the loss function is expressed by the following formula:
[0057]
[0058] in, is the loss function, is the set of users, is a set of overlapping items, and the items included in the overlapping set are related to the user and items that other users have interacted with. The output matrix contains the users The inner product between the eigenvector of and the eigenvector of item i contained in the output matrix, The output matrix contains the users The eigenvectors of the output matrix contain the items The inner product between the eigenvectors of is the input matrix of this iteration, To control the coefficient of the L2 regularization term, is the Sigmoid function.
[0059] Optionally, a condition for terminating the iteration is that the number of iterations reaches a preset number.
[0060] Optionally, the training includes multiple rounds of training, and the item recommendation module is configured to: for each round of training in the multiple rounds of training, calculate the inner product of the feature vector of the user and the feature vector of the item contained in the output matrix of the spectral wavelet collaborative filtering model in each round of training to obtain multiple inner products; select the target inner product whose size ranks first z and the corresponding user has not interacted with the corresponding item from the multiple inner products, wherein z is an integer, and z 1; calculating the recall rate and / or normalized discounted cumulative gain of the target inner product; determining the target training round with the largest recall rate and / or the largest normalized discounted cumulative gain among the multiple rounds of training; and recommending the item indicated by the target inner product to the user indicated by the target inner product corresponding to the target training round.
[0061] Optionally, the normalized Laplace matrix calculation module is configured as:
[0062] Based on the historical interaction information between the user and the project, an interaction matrix is obtained, where if the i-th user and the j-th project have an interaction, the elements contained in the interaction matrix are ;otherwise, ;
[0063] Based on the interaction matrix, calculate the adjacency matrix:
[0064]
[0065] in, is the adjacency matrix, is the interaction matrix, is the transposed matrix of the interaction matrix;
[0066] Calculate the degree matrix of the interaction graph between the user and the project, wherein the interaction graph between the user and the project includes user nodes and project nodes, and if there is interaction between the user and the project, there is an edge between the user node corresponding to the user and the project node corresponding to the project;
[0067] Based on the adjacency matrix and the degree matrix, calculate the normalized adjacency matrix:
[0068]
[0069] in, is the normalized adjacency matrix, and D is the degree matrix;
[0070] Based on the normalized adjacency matrix, the normalized Laplace matrix is calculated:
[0071]
[0072] Among them, I is the project set.
[0073] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the item recommendation method according to the present disclosure.
[0074] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the item recommendation method according to the present disclosure.
[0075] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, which implements the project recommendation method according to the present disclosure when executed by a processor.
[0076] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0077] In the present disclosure, the non-polynomial method is mainly considered, that is, the spectrum filter is designed based on graph wavelet to study graph collaborative filtering. Compared with the polynomial-based spectrum collaborative filtering method, the spectrum filter designed by graph wavelet can capture more scale information, that is, the wavelet transform used in the present disclosure can fit the spectrum signal of any frequency, which makes the features learned by the model richer, that is, the interaction preference between users and projects can be effectively learned by using wavelet transform, thereby improving the accuracy of recommending projects that users are really interested in to users.
[0078] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0080] Figure 1 is a flowchart illustrating an item recommendation method according to an exemplary embodiment of the present disclosure;
[0081] Figure 2 is a diagram illustrating interaction between a user and an item according to an exemplary embodiment of the present disclosure;
[0082] Figure 3 is a schematic diagram illustrating an interaction matrix according to an exemplary embodiment of the present disclosure;
[0083] Figure 4is a schematic diagram showing a degree matrix D of an interaction graph between a user and an item according to an exemplary embodiment of the present disclosure;
[0084] Figure 5 is a specific implementation flow chart showing a project recommendation method according to an exemplary embodiment of the present disclosure;
[0085] Figure 6 is a block diagram illustrating an item recommendation apparatus according to an exemplary embodiment of the present disclosure;
[0086] Figure 7 is a block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0087] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0088] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.
[0089] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three types of parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three types of parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.
[0090] Collaborative filtering is a widely used technology in recommendation algorithms. It aims to learn features from explicit feedback (e.g., ratings, comments, etc.) and implicit feedback (e.g., clicks, browsing, etc.) of users and items, and then predict users' preferences for items. This type of method is easy to expand, can handle user historical behavior well, and give accurate recommendation results in a short time, so it is widely used in various fields. Traditional methods usually use matrix factorization (MF) for collaborative filtering. By decomposing the user-item interaction matrix, users and items are mapped to the same low-dimensional latent semantic space to obtain low-dimensional user and item vector representations.
[0091] In recent years, deep neural networks have been widely used in collaborative filtering frameworks. For example, Neural Collaborative Filtering (NCF) is a deep neural network that combines linear matrix decomposition with nonlinear multilayer perceptrons. It can use multilayer perceptrons instead of inner products to fit complex interaction features between users and items.
[0092] Due to the excellent ability of graph neural networks to process graph data, they have many applications in collaborative filtering, which are usually divided into spatial domain-based methods and spectral domain-based methods. Among them, for spatial domain-based methods, for example, Lightgcn designed a very simple collaborative filtering model based on graph convolutional neural network (Graph Convolution Network, GCN), which removes the feature transformation and nonlinear activation in GCN. For spectral domain-based methods, for example, A Jacobi Polynomial-based Graph Collaborative Filtering (JGCF) designed a spectral domain-based graph neural network and applied a spectral filter kernel based on Jacobi orthogonal polynomials, which can learn the low-frequency and high-frequency information of the user-item interaction graph.
[0093] However, all the current collaborative filtering methods have disadvantages to varying degrees. For example, although the traditional matrix decomposition-based method successfully provides sufficient recommendations, it only considers linear operators when processing user behaviors, and the model has poor expressiveness. It can only use limited data features and has difficulty in processing large-scale high-dimensional data and complex interactions between users and items.
[0094] Although the collaborative filtering method based on deep neural network introduces different nonlinear information, it still ignores the high-order information on the user-item bipartite graph, which may lead to information loss and reduce the final performance.
[0095] For collaborative filtering methods based on graph models, they mainly mine the interaction information in the user-item graph by designing graph filters. Current models mostly use polynomial-based methods. Although they can filter out complex interaction information, usually only the first few orders of the polynomial are effective. Due to the limitations of the polynomial basis, they cannot fit arbitrary filters and usually focus on signals of a certain frequency.
[0096] In order to solve the above problems existing in the related art, the project recommendation method, device, electronic device and storage medium provided by the present disclosure mainly consider non-polynomial methods, that is, designing spectral filters based on graph wavelets to study graph collaborative filtering. Compared with the spectral collaborative filtering method based on polynomials, designing spectral filters through graph wavelets can capture more scale information, that is, the wavelet transform used in the present disclosure can fit the graph signal of any frequency, which makes the features learned by the model richer, that is, the interaction preference between users and projects can be effectively learned by using wavelet transform, thereby improving the accuracy of recommending projects that users are really interested in to users.
[0097] Figure 1 is a flowchart illustrating an item recommendation method according to an exemplary embodiment of the present disclosure.
[0098] Reference Figure 1 In step 101, historical interaction information between the user and the item may be obtained. The "item" may be, but is not limited to, a product, a service, etc. For example, if a user clicks on a link to a product, it can be considered that the user has interacted with the product; or if a user watches a movie, it can be considered that the user has interacted with the movie, etc.
[0099] It should be noted that in the present disclosure, the data set can be divided into a training set and a test set. The training set is mainly used to train the model. Further, the user set in the training set can be represented as , and represent the itemset as , then the number of all users and projects can be given by To express.
[0100] In step 102, a normalized Laplacian matrix reflecting the interaction relationship between the user and the item may be calculated based on the historical interaction information.
[0101] According to an exemplary embodiment of the present disclosure, an interaction matrix can be obtained based on historical interaction information between users and items. If the i-th user and the j-th item have an interaction, the elements contained in the interaction matrix are ;otherwise, .
[0102] For example, suppose there are 3 users, namely Zhang San, Li Si and Wang Er; suppose there are 2 projects, namely Project 1 and Project 2. Also, suppose Zhang San has interacted with both Project 1 and Project 2, Li Si has only interacted with Project 1, and Wang Er has only interacted with Project 1.
[0103] Figure 2 is a diagram showing the interaction between a user and an item according to an exemplary embodiment of the present disclosure. Figure 2 , there are edges between the user node "Zhang San" and the project nodes "Project 1" and "Project 1"; there is an edge between the user node "Li Si" and the project node "Project 1"; there is an edge between the user node "Wang Er" and the project node "Project 1". Figure 3 is a schematic diagram showing an interaction matrix according to an exemplary embodiment of the present disclosure. Figure 3 , the interaction matrix Can be a 3 2-size matrix.
[0104] Then, based on the interaction matrix R, the adjacency matrix can be calculated :
[0105] .
[0106] in, is the transposed matrix of the interaction matrix R.
[0107] Next, the degree matrix D of the user-item interaction graph can be calculated. The user-item interaction graph can contain user nodes and item nodes. If there is an interaction between a user and an item, there is an edge between the user node corresponding to the user and the item node corresponding to the item. Return to reference Figure 2 , the number of edges corresponding to the user node "Zhang San" is 2; the number of edges corresponding to the user node "Li Si" is 1; the number of edges corresponding to the user node "Wang Er" is 1; the number of edges corresponding to the project node "Project 1" is 3; the number of edges corresponding to the project node "Project 2" is 1. Therefore, the degree of each of the above 5 nodes, that is, the number of edges corresponding to each node, can be placed on the diagonal to obtain the 5 5 as the degree matrix D. Figure 4 is a schematic diagram illustrating a degree matrix D of an interaction graph between a user and an item according to an exemplary embodiment of the present disclosure.
[0108] Then, based on the adjacency matrix And the degree matrix D, calculate the normalized adjacency matrix:
[0109] .
[0110] Next, we can use the normalized adjacency matrix , calculate the normalized Laplacian matrix:
[0111] .
[0112] Among them, I is the project set.
[0113] It should be noted that in order to ensure the stability of training, the normalized Laplace matrix is usually used during model training. .
[0114] In step 103, the sum of the products of the learnable coefficients and the Haar wavelet at each scale in the preset multiple scales may be calculated as the spectral filter function.
[0115] Among them, wavelets usually consist of a mother wavelet and a scaling function, which are designed to represent finite energy functions based on specific building blocks of different scales and positions. The advantage of wavelets is that they can capture the information of rapidly changing signals, and their performance is significantly better than that of polynomial bases. Wavelet analysis based on multi-scale analysis can divide the quadratic Lebesgue space into a finite number of subspaces, and wavelet bases of different scales can be used to fit the information contained in the subspaces.
[0116] It should be noted that the traditional collaborative filtering method has a simple model design, low utilization of user-item interaction information, and low recommendation accuracy. In the present disclosure, a collaborative filtering method based on spectral wavelet is used, which has a more complex algorithm logic, so it has a wider range of applications and a higher recommendation accuracy.
[0117] According to an exemplary embodiment of the present disclosure, the spectral filter function may be constructed by the following formula:
[0118]
[0119]
[0120] in, is the spectral filter function, for Haar wavelet, is the scaling parameter, is the translation parameter, is the maximum scale among the above preset multiple scales, is the eigenvalue variable, is the learnable coefficient, is the learnable coefficient The set in the range of h=0~h=H can be learned through neural network. for The set in the range h=0~h=H.
[0121] It means the scaling parameter is , the translation parameter is k, and the signal at scale h. According to multi-scale analysis, the signal can be divided into scale H, and the spectral signal can be reconstructed using the linear combination of signals of different scales from 0 to H. That is, the present disclosure can use multi-scale analysis to reconstruct the spectrum signal, divide the spectrum signal according to different scales, and use the scaling function of Haar wavelet to construct the spectrum filter. Wavelet has the ability to learn any spectrum filter, so it can be used to reconstruct any function.
[0122] It should be noted that the design of the spatial domain-based graph collaborative filtering method is relatively simple, and usually uses message passing on the graph to iteratively aggregate the domain information of the nodes. The learned features usually contain more noise, and the training and updating of the model usually requires a high time cost. In the present disclosure, multi-scale analysis and wavelet analysis are mainly used to cyclically construct wavelet basis functions of any scale through the scale function of the wavelet basis. The training process will be simpler, the time cost will be lower, and the ability to filter noise will be stronger.
[0123] Moreover, for the graph collaborative filtering method based on the spectral domain, its core is to perform graph Fourier transform through an orthogonal polynomial basis to learn the spectral signal of the graph, but this method is very dependent on the design of the polynomial basis, and the learned graph spectrum frequency signal is relatively simple. In the present disclosure, graph spectrum collaborative filtering is studied from a non-polynomial perspective. The wavelet transform used can fit the graph spectrum signal of any frequency, which can ensure that the interactive information of the user-item bipartite graph is effectively learned, that is, the features learned by the model are richer, thereby improving the quality of project recommendations.
[0124] In step 104, a spectral filter function may be used Filtering the Normalized Laplacian Matrix , and obtain the graph wavelet basis.
[0125] According to an exemplary embodiment of the present disclosure, the normalized Laplacian matrix , get the normalized Laplacian matrix The eigenvectors and normalized Laplacian matrix of It should be noted that due to is a symmetric positive definite matrix, so its eigenvalues can be obtained by eigendecomposition and the corresponding eigenvector :
[0126]
[0127] in, is an orthogonal matrix whose columns can form an orthogonal basis of eigenvectors, is a diagonal matrix with corresponding eigenvalues on the diagonal. .
[0128] Next, the spectral filter function can be used by the following formula Filtering the Normalized Laplacian Matrix The eigenvalue of , and obtain the graph wavelet basis:
[0129]
[0130] in, is the graph wavelet basis.
[0131] In step 105, the spectral wavelet collaborative filtering model can be trained based on the preset initial input matrix. The spectral wavelet collaborative filtering model is constructed as the graph convolution propagation matrix of the spectral wavelet collaborative filtering model. The preset initial input matrix may include the initial feature vector of the user and the initial feature vector of the item.
[0132] It should be noted that for user sets Each user in and each item in item set I can randomly initialize a learnable embedding to obtain the preset initial input matrix , where each user's feature vector and each item's feature vector can be embedded in a d-dimensional space, and a suitable dimension d can be selected based on the final experimental results. Exemplarily, the dimension d can be selected from {32, 64, 128}.
[0133] According to an exemplary embodiment of the present disclosure, the spectral wavelet collaborative filtering model may be trained in an iterative manner, wherein for each iteration process, the following operations may be performed:
[0134] Get the input matrix at the beginning of this iteration. Then, based on the input matrix at the beginning of this iteration and the wavelet basis , calculate the output matrix of this iteration. Next, the value of the loss function can be calculated based on the input matrix and output matrix of this iteration. Then, based on the value of the loss function, adjust , and the output matrix of this iteration can be used as the input matrix at the beginning of the next iteration of this iteration. Among them, the input matrix at the beginning of the first iteration can be the above-mentioned preset initial input matrix .
[0135] According to the exemplary embodiments of the present disclosure, a The spectral wavelet collaborative filtering model of the layer can then be used with the above preset initial input matrix As the input of the spectral wavelet collaborative filtering model, the above graph wavelet basis Reconstruct the propagation matrix of graph convolution. In the process of graph convolution, the convolution result of the previous layer can be used as the input of the next layer. Finally, the convolution result of each layer and the initial embedding can be combined as the final embedding.
[0136] The output matrix of this iteration can be calculated by the following formula, that is, the training process of the model can be as follows:
[0137]
[0138]
[0139] in, is the output matrix of this iteration, is the number of layers contained in the spectral wavelet collaborative filtering model, is the output matrix of the qth layer of the spectral wavelet collaborative filtering model, is the output matrix of the (q-1)th layer of the spectral wavelet collaborative filtering model. is the input matrix at the beginning of this iteration.
[0140] According to an exemplary embodiment of the present disclosure, the above loss function can be expressed by the following formula:
[0141]
[0142] in, is the loss function, is a collection of users, The overlapping set of items can contain items that are related to the user. and items that other users have interacted with. is the number of users included in the output matrix E The inner product between the eigenvector of and the eigenvector of item i contained in the output matrix E, is the number of users included in the output matrix E The eigenvectors of The inner product between the eigenvectors of is the input matrix of this iteration, To control the coefficient of the L2 regularization term, is the Sigmoid function, and It can be expressed by the following formula:
[0143] .
[0144] It should be noted that The Bayesian Personalized Ranking (BPR) loss is a pairwise loss that trains user and item embeddings by encouraging observed interactions to have higher prediction scores than unobserved interactions.
[0145] According to an exemplary embodiment of the present disclosure, the condition for terminating the above iteration may be: the number of iterations reaches a preset number. It should be noted that the user can set the preset number according to his own needs. For example, the preset number can be set to 1000 times.
[0146] In step 106, based on the spectral wavelet collaborative filtering model obtained after the training is completed, the items among the above items that have not interacted with the user can be recommended to the user.
[0147] According to an exemplary embodiment of the present disclosure, as mentioned above, the above training may include multiple rounds of training. For each round of training in the multiple rounds of training, the feature vector of the user included in the output matrix E of the spectral wavelet collaborative filtering model in each round of training may be calculated. and the feature vector of the item The inner product of , and obtain multiple inner products. Among them, It can represent the interest score of user u for item i:
[0148] .
[0149] Then, the target inner products whose sizes rank in the top z and whose corresponding users and corresponding items have not interacted can be selected from the above multiple inner products. Where z is an integer, and z 1. That is, the above-mentioned multiple inner products can be arranged in descending order, and then the target inner products whose sizes rank in the top z and whose corresponding users have not interacted with the corresponding items can be selected from the multiple inner products arranged in descending order. Next, the recall rate (Recall) and / or the normalized discounted cumulative gain (NDCG) of the target inner product can be calculated. Then, the target training round with the largest corresponding recall rate and / or normalized discounted cumulative gain in multiple rounds of training can be determined. Exemplarily, the target training round with the largest corresponding recall rate and / or normalized discounted cumulative gain in 1000 rounds of training can be determined. Next, the item indicated by the target inner product can be recommended to the user indicated by the target inner product corresponding to the target training round.
[0150] That is, in the present disclosure, the filtered embedding can be used to recommend items, and the predicted interest score of user u for item i can be obtained by the inner product of the corresponding final embedding. Once the model parameters are learned, a personalized ranking list can be calculated based on the predicted interest scores of all items. That is, the predicted interest scores can be sorted in descending order, and the first k uninteracted items can be selected as the recommendation results, where k is the length of the recommendation list.
[0151] It should be noted that the above recall rate (Recall) can be calculated by the following formula:
[0152]
[0153] in, It can be the set of the top k items that need to be recommended predicted by the model, and T(u) can represent the set of the top k items recommended in the real test set. It can be seen that the recall rate mainly represents the proportion of relevant items in the top-k recommendation list. The larger the recall rate, the better the effect of the recommendation model.
[0154] The above normalized discounted cumulative gain (NDCG) can be calculated by the following formula:
[0155]
[0156] in, It can indicate whether the item at the i-th position in the real test set is liked by the user. If liked, then is 1; otherwise, is 0.
[0157] IDCG is the ideal DCG, that is, the situation where DCG achieves the maximum value:
[0158]
[0159] Among them, REL represents the original recall set sorted from large to small according to the score, and the DCG is calculated based on the sorted set to obtain IDCG.
[0160]
[0161] The value of NDCG is DCG divided by IDCG. The larger the NDCG value, the better the recommendation model is.
[0162] It should be noted that, as mentioned above, for each round of training in multiple rounds of training, the recall rate and / or normalized cumulative loss gain corresponding to each round of training can be calculated and projects can be recommended to users based on the calculation results. However, if the calculation operation is repeated for each round of training, more computing resources will be consumed. Therefore, according to an exemplary embodiment of the present disclosure, the recall rate and / or normalized cumulative loss gain can also be calculated once every preset training round, and then the project recommendation can be performed only based on the calculation results of these training rounds. For example, in the process of model learning, the Recall value and / or NDCG value can be tested every 10 epochs. In this way, the repeated calculation process is greatly reduced, and computing resources can be effectively saved.
[0163] In view of the problem that the spectral collaborative filtering method based on polynomial basis in the related art filters the signal with a single frequency, in the present disclosure, the main consideration is the non-polynomial method, that is, designing a spectral filter based on graph wavelet, using wavelet signals to learn information of more scales, thereby alleviating the problem of sparse recommendation data and improving the cold start problem, and effectively learning the low-dimensional embedding of the user-item bipartite graph, thereby improving the quality of item recommendations.
[0164] Figure 5 is a flowchart showing a specific implementation of an item recommendation method according to an exemplary embodiment of the present disclosure.
[0165] Reference Figure 5 , in step 501, data is preprocessed.
[0166] Specifically, the interaction matrix R can be obtained based on the historical interaction information between users and items. Then, the adjacency matrix can be calculated based on the interaction matrix R. Next, we can calculate the degree matrix D of the interaction graph between users and items. Then, we can use the adjacency matrix And degree matrix D, calculate the normalized adjacency matrix Next, we can use the normalized adjacency matrix , calculate the normalized Laplacian matrix The implementation process of obtaining each matrix has been described in detail in the previous embodiment and will not be repeated here.
[0167] In step 502, the spectral filter is reconstructed using Haar wavelet:
[0168] .
[0169] In step 503, the normalized Laplacian matrix is filtered using a spectral filter function , and get the wavelet basis :
[0170]
[0171] In step 504, the initial input matrix, i.e., the initial embedding matrix of user and item, is preset. As the input of the spectral wavelet collaborative filtering model, the graph wavelet basis Reconstruct the propagation matrix of graph convolution to train the spectral wavelet collaborative filtering model:
[0172]
[0173]
[0174] in, is the output matrix, is the number of layers contained in the spectral wavelet collaborative filtering model, is the output matrix of the qth layer of the spectral wavelet collaborative filtering model, is the output matrix of the (q-1)th layer of the spectral wavelet collaborative filtering model. is the input matrix.
[0175] In addition, the loss function during training can be used ,about The specific formula of has been described in detail in the previous embodiment and will not be repeated here.
[0176] In step 505, item recommendations are performed based on the output matrix of the spectral wavelet collaborative filtering model obtained after the training is completed.
[0177] Specifically, the filtered embeddings can be used for item recommendation, and the predicted interest score of user u for item i can be obtained by the inner product of the corresponding final embeddings. Once the model parameters are learned, a personalized ranking list can be calculated based on the predicted interest scores of all items. That is, the predicted interest scores can be sorted in descending order, and the first k uninteracted items can be selected as the recommendation results, where k is the length of the recommendation list.
[0178] Figure 6 is a block diagram illustrating an item recommendation apparatus 600 according to an exemplary embodiment of the present disclosure.
[0179] Reference Figure 6 The project recommendation device 600 may include an interaction information acquisition module 601, a normalized Laplace matrix calculation module 602, a spectral filter function calculation module 603, a filtering module 604, a training module 605 and a project recommendation module 606.
[0180] The interaction information acquisition module 601 can acquire historical interaction information between the user and the project. The "project" can be, but is not limited to, a product, a service, etc. For example, if a user clicks on a link to a product, it can be considered that the user has interacted with the product; or if a user watches a movie, it can be considered that the user has interacted with the movie, etc.
[0181] It should be noted that in the present disclosure, the data set can be divided into a training set and a test set. The training set is mainly used to train the model. Further, the user set in the training set can be represented as , and represent the itemset as , then the number of all users and projects can be given by To express.
[0182] The normalized Laplacian matrix calculation module 602 may calculate a normalized Laplacian matrix reflecting the interaction relationship between the user and the item based on the historical interaction information.
[0183] According to an exemplary embodiment of the present disclosure, the normalized Laplacian matrix calculation module 602 can obtain an interaction matrix based on historical interaction information between users and items. If the i-th user and the j-th item have an interaction, the elements contained in the interaction matrix are ;otherwise, .
[0184] Then, the normalized Laplacian matrix calculation module 602 can calculate the adjacency matrix based on the interaction matrix R: :
[0185] .
[0186] in, is the transposed matrix of the interaction matrix R.
[0187] Next, the normalized Laplace matrix calculation module 602 can calculate the degree matrix D of the interaction graph between the user and the project. The interaction graph between the user and the project can include user nodes and project nodes. If there is interaction between the user and the project, there is an edge between the user node corresponding to the user and the project node corresponding to the project.
[0188] Then, the normalized Laplacian matrix calculation module 602 can be based on the adjacency matrix And the degree matrix D, calculate the normalized adjacency matrix:
[0189] .
[0190] Next, the normalized Laplacian matrix calculation module 602 can calculate the normalized adjacency matrix based on the normalized adjacency matrix , calculate the normalized Laplacian matrix:
[0191] .
[0192] Among them, I is the project set.
[0193] It should be noted that in order to ensure the stability of training, the normalized Laplace matrix is usually used during model training. .
[0194] The spectral filter function calculation module 603 may calculate the sum of the products of the learnable coefficient and the Haar wavelet at each scale in the preset multiple scales as the spectral filter function.
[0195] Among them, wavelets usually consist of a mother wavelet and a scaling function, which are designed to represent finite energy functions based on specific building blocks of different scales and positions. The advantage of wavelets is that they can capture the information of rapidly changing signals, and their performance is significantly better than that of polynomial bases. Wavelet analysis based on multi-scale analysis can divide the quadratic Lebesgue space into a finite number of subspaces, and wavelet bases of different scales can be used to fit the information contained in the subspaces.
[0196] It should be noted that the traditional collaborative filtering method has a simple model design, low utilization of user-item interaction information, and low recommendation accuracy. In the present disclosure, a collaborative filtering method based on spectral wavelet is used, which has a more complex algorithm logic, so it has a wider range of applications and a higher recommendation accuracy.
[0197] According to an exemplary embodiment of the present disclosure, the spectral filter function calculation module 603 may construct a spectral filter function by the following formula:
[0198]
[0199]
[0200] in, is the spectral filter function, for Haar wavelet, is the scaling parameter, is the translation parameter, is the maximum scale among the above preset multiple scales, is the eigenvalue variable, is the learnable coefficient, is the learnable coefficient The set in the range of h=0~h=H can be learned through neural network. for The set in the range h=0~h=H.
[0201] It means the scaling parameter is , the translation parameter is k, and the signal at scale h. According to multi-scale analysis, the signal can be divided into scale H, and the spectral signal can be reconstructed using the linear combination of signals of different scales from 0 to H. That is, the present disclosure can use multi-scale analysis to reconstruct the spectrum signal, divide the spectrum signal according to different scales, and use the scaling function of Haar wavelet to construct the spectrum filter. Wavelet has the ability to learn any spectrum filter, so it can be used to reconstruct any function.
[0202] It should be noted that the design of the spatial domain-based graph collaborative filtering method is relatively simple, and usually uses message passing on the graph to iteratively aggregate the domain information of the nodes. The learned features usually contain more noise, and the training and updating of the model usually requires a high time cost. In the present disclosure, multi-scale analysis and wavelet analysis are mainly used to cyclically construct wavelet basis functions of any scale through the scale function of the wavelet basis. The training process will be simpler, the time cost will be lower, and the ability to filter noise will be stronger.
[0203] Moreover, for the graph collaborative filtering method based on the spectral domain, its core is to perform graph Fourier transform through an orthogonal polynomial basis to learn the spectral signal of the graph, but this method is very dependent on the design of the polynomial basis, and the learned graph spectrum frequency signal is relatively simple. In the present disclosure, graph spectrum collaborative filtering is studied from a non-polynomial perspective. The wavelet transform used can fit the graph spectrum signal of any frequency, which can ensure that the interactive information of the user-item bipartite graph is effectively learned, that is, the features learned by the model are richer, thereby improving the quality of project recommendations.
[0204] The filtering module 604 can use a spectral filter function Filtering the Normalized Laplacian Matrix , and obtain the graph wavelet basis.
[0205] According to an exemplary embodiment of the present disclosure, the filtering module 604 may be based on a normalized Laplacian matrix , get the normalized Laplacian matrix The eigenvectors and normalized Laplacian matrix of It should be noted that due to is a symmetric positive definite matrix, so its eigenvalues can be obtained by eigendecomposition and the corresponding eigenvector :
[0206]
[0207] in, is an orthogonal matrix whose columns can form an orthogonal basis of eigenvectors, is a diagonal matrix with corresponding eigenvalues on the diagonal. .
[0208] Next, the filtering module 604 can use the spectral filter function by the following formula Filtering the Normalized Laplacian Matrix The eigenvalue of , and obtain the graph wavelet basis:
[0209]
[0210] in, is the graph wavelet basis.
[0211] The training module 605 can train the spectral wavelet collaborative filtering model based on the preset initial input matrix. The spectral wavelet collaborative filtering model is constructed as the graph convolution propagation matrix of the spectral wavelet collaborative filtering model. The preset initial input matrix may include the initial feature vector of the user and the initial feature vector of the item.
[0212] It should be noted that for user sets Each user in and each item in item set I can randomly initialize a learnable embedding to obtain the preset initial input matrix , where each user's feature vector and each item's feature vector can be embedded in a d-dimensional space, and a suitable dimension d can be selected based on the final experimental results. Exemplarily, the dimension d can be selected from {32, 64, 128}.
[0213] According to an exemplary embodiment of the present disclosure, the training module 605 may train the spectral wavelet collaborative filtering model in an iterative manner, wherein for each iteration process, the following operations may be performed:
[0214] Get the input matrix at the beginning of this iteration. Then, based on the input matrix at the beginning of this iteration and the wavelet basis , calculate the output matrix of this iteration. Next, the value of the loss function can be calculated based on the input matrix and output matrix of this iteration. Then, based on the value of the loss function, adjust , and the output matrix of this iteration can be used as the input matrix at the beginning of the next iteration of this iteration. Among them, the input matrix at the beginning of the first iteration can be the above-mentioned preset initial input matrix .
[0215] According to the exemplary embodiments of the present disclosure, a The spectral wavelet collaborative filtering model of the layer can then be used with the above preset initial input matrix As the input of the spectral wavelet collaborative filtering model, the above graph wavelet basis Reconstruct the propagation matrix of graph convolution. In the process of graph convolution, the convolution result of the previous layer can be used as the input of the next layer. Finally, the convolution result of each layer and the initial embedding can be combined as the final embedding.
[0216] The training module 605 can calculate the output matrix of this iteration by the following formula, that is, the training process of the model can be as follows:
[0217]
[0218]
[0219] in, is the output matrix of this iteration, is the number of layers contained in the spectral wavelet collaborative filtering model, is the output matrix of the qth layer of the spectral wavelet collaborative filtering model, is the output matrix of the (q-1)th layer of the spectral wavelet collaborative filtering model. is the input matrix at the beginning of this iteration.
[0220] According to an exemplary embodiment of the present disclosure, the above loss function can be expressed by the following formula:
[0221]
[0222] in, is the loss function, is a collection of users, The overlapping set of items can contain items that are related to the user. and items that other users have interacted with. is the number of users included in the output matrix E The inner product between the eigenvector of and the eigenvector of item i contained in the output matrix E, is the number of users included in the output matrix E The eigenvectors of The inner product between the eigenvectors of is the input matrix of this iteration, To control the coefficient of the L2 regularization term, is the Sigmoid function, and It can be expressed by the following formula:
[0223] .
[0224] It should be noted that The Bayesian Personalized Ranking (BPR) loss is a pairwise loss that trains user and item embeddings by encouraging observed interactions to have higher prediction scores than unobserved interactions.
[0225] According to an exemplary embodiment of the present disclosure, the condition for terminating the above iteration may be: the number of iterations reaches a preset number. It should be noted that the user can set the preset number according to his own needs. For example, the preset number can be set to 1000 times.
[0226] The project recommendation module 606 can recommend to the user projects that have not interacted with the user among the above projects based on the spectral wavelet collaborative filtering model obtained after the training is completed.
[0227] According to an exemplary embodiment of the present disclosure, as mentioned above, the above training may include multiple rounds of training. For each round of training in the multiple rounds of training, the item recommendation module 606 may calculate the user's feature vector contained in the output matrix E of the spectral wavelet collaborative filtering model in each round of training: and the feature vector of the item The inner product of , and obtain multiple inner products. Among them, It can represent the interest score of user u for item i:
[0228] .
[0229] Then, the item recommendation module 606 may select the target inner products whose sizes rank first z from the above multiple inner products and whose corresponding users have not interacted with the corresponding items. 1. That is, the above-mentioned multiple inner products can be arranged in descending order, and then the target inner products whose sizes rank in the top z and whose corresponding users have not interacted with the corresponding items can be selected from the multiple inner products arranged in descending order. Next, the project recommendation module 606 can calculate the recall rate (Recall) and / or the normalized discount cumulative gain (NDCG) of the target inner product. Then, the project recommendation module 606 can determine the target training round with the largest corresponding recall rate and / or normalized discount cumulative gain in multiple rounds of training. Exemplarily, the target training round with the largest corresponding recall rate and / or normalized discount cumulative gain in 1000 rounds of training can be determined. Next, the project recommendation module 606 can recommend the project indicated by the target inner product to the user indicated by the target inner product corresponding to the target training round.
[0230] That is, in the present disclosure, the filtered embedding can be used to recommend items, and the predicted interest score of user u for item i can be obtained by the inner product of the corresponding final embedding. Once the model parameters are learned, a personalized ranking list can be calculated based on the predicted interest scores of all items. That is, the predicted interest scores can be sorted in descending order, and the first k uninteracted items can be selected as the recommendation results, where k is the length of the recommendation list.
[0231] Figure 7 is a block diagram illustrating an electronic device 700 according to an exemplary embodiment of the present disclosure.
[0232] Reference Figure 7 The electronic device 700 includes at least one memory 701 and at least one processor 702. The at least one memory 701 stores instructions. When the instructions are executed by the at least one processor 702, the item recommendation method according to the exemplary embodiment of the present disclosure is executed.
[0233] As an example, the electronic device 700 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above instructions. Here, the electronic device 700 is not necessarily a single electronic device, but may also be any device or circuit collection capable of executing the above instructions (or instruction sets) individually or in combination. The electronic device 700 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
[0234] In the electronic device 700, the processor 702 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0235] The processor 702 may execute instructions or codes stored in the memory 701, which may also store data. Instructions and data may also be sent and received over a network via a network interface device, which may employ any known transmission protocol.
[0236] The memory 701 may be integrated with the processor 702, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 701 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 701 and the processor 702 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 702 can read files stored in the memory.
[0237] In addition, the electronic device 700 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 700 may be connected to each other via a bus and / or a network.
[0238] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium may also be provided, and when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is able to perform the above-mentioned project recommendation method. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0239] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided, including a computer program, and when the computer program is executed by a processor, the item recommendation method according to the present disclosure is implemented.
[0240] According to the project recommendation method, device, electronic device and storage medium disclosed in the present invention, a non-polynomial method is mainly considered, that is, a spectrum filter is designed based on graph wavelet to study graph collaborative filtering. Compared with the polynomial-based spectral collaborative filtering method, the spectrum filter designed by graph wavelet can capture more scale information, that is, the wavelet transform used in the present invention can fit the graph signal of any frequency, which makes the features learned by the model richer, that is, the interaction preference between users and projects can be effectively learned by using wavelet transform, thereby improving the accuracy of recommending projects that users are really interested in to users.
[0241] According to the exemplary embodiments of the present disclosure, the traditional collaborative filtering method has a simple model design, low utilization of user-item interaction information, and low recommendation accuracy. In the present disclosure, a collaborative filtering method based on spectral wavelet is adopted, which has a more complex algorithm logic, so it has a wider range of applications and a higher recommendation accuracy.
[0242] According to an exemplary embodiment of the present disclosure, for a graph collaborative filtering method based on spatial domain, its design is relatively simple, and it usually uses message passing on the graph to iteratively aggregate the domain information of nodes. The learned features usually contain more noise, and the training and updating of the model usually requires a high time cost. In the present disclosure, multi-scale analysis and wavelet analysis are mainly used to cyclically construct wavelet basis functions of any scale through the scale function of the wavelet basis. The training process will be simpler, the time cost will be lower, and the ability to filter noise will be stronger.
[0243] According to an exemplary embodiment of the present disclosure, for a graph collaborative filtering method based on the spectral domain, its core is to perform graph Fourier transform through an orthogonal polynomial basis to learn the spectral signal of the graph, but this method is highly dependent on the design of the polynomial basis, and the learned graph spectrum frequency signal is relatively simple. In the present disclosure, graph spectrum collaborative filtering is studied from a non-polynomial perspective, and the wavelet transform used can fit the graph spectrum signal of any frequency, which can ensure that the interactive information of the user-item bipartite graph is effectively learned, that is, the features learned by the model are richer, thereby improving the quality of project recommendations.
[0244] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0245] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A project recommendation method, characterized in that: include: Get historical interaction information between users and projects; Based on the historical interaction information, calculating a normalized Laplace matrix reflecting the interaction relationship between the user and the item; Calculate the sum of the products of the learnable coefficient and the Haar wavelet at each of the preset multiple scales as the spectral filter function; Filtering the normalized Laplace matrix using the spectral filter function to obtain a graph wavelet basis; Based on a preset initial input matrix, training is performed on a spectral graph wavelet collaborative filtering model, wherein the spectral graph wavelet collaborative filtering model is constructed by using the graph wavelet basis as a graph convolution propagation matrix of the spectral graph wavelet collaborative filtering model, wherein the preset initial input matrix includes an initial feature vector of the user and an initial feature vector of the item; Based on the spectral wavelet collaborative filtering model obtained after the training is completed, the items among the items with which the user has not interacted are recommended to the user.
2. The project recommendation method according to claim 1, characterized in that: The calculation presets the sum of the products of the learnable coefficients and the Haar wavelet at each scale in the plurality of scales as a spectral filter function, including: The spectral filter function is constructed by the following formula: in, is the spectral filter function, is the Haar wavelet, is the scaling parameter, is the translation parameter, is the maximum scale among the preset multiple scales, is the eigenvalue variable, is the learnable coefficient, is the learnable coefficient exist =0~ = The collection within the range, for exist =0~ = A collection within the scope.
3. The project recommendation method according to claim 2, characterized in that: The step of filtering the normalized Laplace matrix using the spectral filter function to obtain a graph wavelet basis includes: Based on the normalized Laplace matrix, obtaining an eigenvector of the normalized Laplace matrix and an eigenvalue of the normalized Laplace matrix; The eigenvalues of the normalized Laplace matrix are filtered using the spectral filter function through the following formula to obtain the graph wavelet basis: in, is the wavelet basis of the graph, is the eigenvector of the normalized Laplacian matrix, The eigenvalues of the normalized Laplacian matrix.
4. The project recommendation method according to claim 3, characterized in that: The training of the spectral wavelet collaborative filtering model based on the preset initial input matrix includes: Training the spectral wavelet collaborative filtering model in an iterative manner; In each iteration, the following operations are performed: Get the input matrix at the beginning of this iteration; Based on the input matrix at the beginning of this iteration and the graph wavelet basis, the output matrix of this iteration is calculated; Calculate the value of the loss function based on the input matrix and output matrix of this iteration; Based on the value of the loss function, adjust the , and use the output matrix of this iteration as the input matrix at the beginning of the next iteration of this iteration, wherein the input matrix at the beginning of the first iteration is the preset initial input matrix.
5. The project recommendation method according to claim 4, characterized in that: The step of calculating the output matrix of this iteration based on the input matrix at the beginning of this iteration and the graph wavelet basis includes: The output matrix of this iteration is calculated by the following formula: in, is the output matrix of this iteration, is the number of layers contained in the spectral wavelet collaborative filtering model, is the output matrix of the qth layer of the spectral wavelet collaborative filtering model, is the output matrix of the (q-1)th layer of the spectral wavelet collaborative filtering model. is the input matrix at the beginning of this iteration.
6. The project recommendation method according to claim 4, characterized in that: The loss function is expressed by the following formula: in, is the loss function, is the set of users, is a set of overlapping items, and the items included in the overlapping set are related to the user and items that other users have interacted with. The output matrix contains the users The inner product between the eigenvector of and the eigenvector of item i contained in the output matrix, The output matrix contains the users The eigenvectors of the output matrix contain the items The inner product between the eigenvectors of is the input matrix of this iteration, To control the coefficient of the L2 regularization term, is the Sigmoid function.
7. The project recommendation method according to claim 4, characterized in that: The conditions for the iteration to terminate are: The number of iterations reaches the preset number.
8. The project recommendation method according to claim 1, characterized in that: The training comprises multiple rounds of training, and the recommending to the user items among the items that have not been interacted with by the user based on the spectral wavelet collaborative filtering model obtained after the training is completed comprises: For each round of training in the multiple rounds of training, calculating the inner product of the feature vector of the user and the feature vector of the item contained in the output matrix of the spectral wavelet collaborative filtering model in each round of training to obtain multiple inner products; Select the target inner products whose sizes rank first z from the multiple inner products and whose corresponding users have not interacted with the corresponding items, where z is an integer and z 1; Calculating the recall rate and / or normalized discounted cumulative gain of the target inner product; Determine a target training round in which the recall rate and / or the normalized discount cumulative gain corresponding to the multiple rounds of training is the largest; The item indicated by the target inner product is recommended to the user indicated by the target inner product corresponding to the target training round.
9. The project recommendation method according to claim 1, characterized in that: The calculating, based on the historical interaction information, a normalized Laplace matrix reflecting the interaction relationship between the user and the item includes: Based on the historical interaction information between the user and the project, an interaction matrix is obtained, where if the i-th user and the j-th project have an interaction, the elements contained in the interaction matrix are ;otherwise, ; Based on the interaction matrix, calculate the adjacency matrix: in, is the adjacency matrix, is the interaction matrix, is the transposed matrix of the interaction matrix; Calculate the degree matrix of the interaction graph between the user and the project, wherein the interaction graph between the user and the project includes user nodes and project nodes, and if there is interaction between the user and the project, there is an edge between the user node corresponding to the user and the project node corresponding to the project; Based on the adjacency matrix and the degree matrix, calculate the normalized adjacency matrix: in, is the normalized adjacency matrix, and D is the degree matrix; Based on the normalized adjacency matrix, the normalized Laplace matrix is calculated: Among them, I is the project set.
10. A project recommendation device, characterized in that: include: An interaction information acquisition module, configured to acquire historical interaction information between a user and an item; a normalized Laplace matrix calculation module, configured to calculate a normalized Laplace matrix reflecting the interaction relationship between the user and the item based on the historical interaction information; A spectral filter function calculation module is configured to calculate the sum of products of the learnable coefficient and the Haar wavelet at each scale in a plurality of preset scales as a spectral filter function; A filtering module, configured to filter the normalized Laplace matrix using the spectral filter function to obtain a graph wavelet basis; A training module is configured to train a spectral wavelet collaborative filtering model based on a preset initial input matrix, wherein the spectral wavelet collaborative filtering model is constructed by using the graph wavelet basis as a graph convolution propagation matrix of the spectral wavelet collaborative filtering model, wherein the preset initial input matrix includes an initial feature vector of the user and an initial feature vector of the project; The project recommendation module is configured to recommend to the user projects that have not been interacted with by the user based on the spectral wavelet collaborative filtering model obtained after training.
11. The project recommendation device according to claim 10, characterized in that: The spectral filter function calculation module is configured as follows: The spectral filter function is constructed by the following formula: in, is the spectral filter function, is the Haar wavelet, is the scaling parameter, is the translation parameter, is the maximum scale among the preset multiple scales, is the eigenvalue variable, is the learnable coefficient, is the learnable coefficient exist =0~ = The collection within the range, for exist =0~ = A collection within the scope.
12. The project recommendation device according to claim 11, characterized in that: The filtering module is configured to: Based on the normalized Laplace matrix, obtaining an eigenvector of the normalized Laplace matrix and an eigenvalue of the normalized Laplace matrix; The eigenvalues of the normalized Laplace matrix are filtered using the spectral filter function through the following formula to obtain the graph wavelet basis: in, is the wavelet basis of the graph, is the eigenvector of the normalized Laplacian matrix, The eigenvalues of the normalized Laplacian matrix.
13. The project recommendation device according to claim 12, characterized in that: The training module is configured as follows: Training the spectral wavelet collaborative filtering model in an iterative manner; In each iteration, the following operations are performed: Get the input matrix at the beginning of this iteration; Based on the input matrix at the beginning of this iteration and the graph wavelet basis, the output matrix of this iteration is calculated; Calculate the value of the loss function based on the input matrix and output matrix of this iteration; Based on the value of the loss function, adjust the , and use the output matrix of this iteration as the input matrix at the beginning of the next iteration of this iteration, wherein the input matrix at the beginning of the first iteration is the preset initial input matrix.
14. The project recommendation device according to claim 13, characterized in that: The training module is configured as follows: The output matrix of this iteration is calculated by the following formula: in, is the output matrix of this iteration, is the number of layers contained in the spectral wavelet collaborative filtering model, is the output matrix of the qth layer of the spectral wavelet collaborative filtering model, is the output matrix of the (q-1)th layer of the spectral wavelet collaborative filtering model. is the input matrix at the beginning of this iteration.
15. The project recommendation device according to claim 13, characterized in that: The loss function is expressed by the following formula: in, is the loss function, is the set of users, is a set of overlapping items, and the items included in the overlapping set are related to the user and items that other users have interacted with. The output matrix contains the users The inner product between the eigenvector of and the eigenvector of item i contained in the output matrix, The output matrix contains the users The eigenvectors of the output matrix contain the items The inner product between the eigenvectors of is the input matrix of this iteration, To control the coefficient of the L2 regularization term, is the Sigmoid function.
16. The project recommendation device according to claim 13, characterized in that: The conditions for the iteration to terminate are: The number of iterations reaches the preset number.
17. The project recommendation device according to claim 10, characterized in that: The training includes multiple rounds of training, and the item recommendation module is configured as follows: For each round of training in the multiple rounds of training, calculating the inner product of the feature vector of the user and the feature vector of the item contained in the output matrix of the spectral wavelet collaborative filtering model in each round of training to obtain multiple inner products; Select the target inner products whose sizes rank first z from the multiple inner products and whose corresponding users have not interacted with the corresponding items, where z is an integer and z 1; Calculating the recall rate and / or normalized discounted cumulative gain of the target inner product; Determine a target training round in which the recall rate and / or the normalized discount cumulative gain corresponding to the multiple rounds of training is the largest; The item indicated by the target inner product is recommended to the user indicated by the target inner product corresponding to the target training round.
18. The project recommendation device according to claim 10, characterized in that: The normalized Laplace matrix calculation module is configured as follows: Based on the historical interaction information between the user and the project, an interaction matrix is obtained, where if the i-th user and the j-th project have an interaction, the elements contained in the interaction matrix are ;otherwise, ; Based on the interaction matrix, calculate the adjacency matrix: in, is the adjacency matrix, is the interaction matrix, is the transposed matrix of the interaction matrix; Calculate the degree matrix of the interaction graph between the user and the project, wherein the interaction graph between the user and the project includes user nodes and project nodes, and if there is interaction between the user and the project, there is an edge between the user node corresponding to the user and the project node corresponding to the project; Based on the adjacency matrix and the degree matrix, calculate the normalized adjacency matrix: in, is the normalized adjacency matrix, and D is the degree matrix; Based on the normalized adjacency matrix, the normalized Laplace matrix is calculated: Among them, I is the project set.
19. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the project recommendation method as described in any one of claims 1 to 9.
20. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the item recommendation method as described in any one of claims 1 to 9.
21. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the item recommendation method according to any one of claims 1 to 9 is implemented.
