Next interest point recommendation method based on self-adaptive graph and future preference
Technical Field
The invention belongs to the field of recommendation systems, and discloses a next interest point recommendation method realized by applying adaptive graph learning and future preference.
Background
Today, the rapid development of modernization, the demand for personalized services is increasing, various leisure, entertainment and play sites are layered endlessly, and the rapid development of location-based social networks (LBSN) has spawned a recommendation system in combination with itself, resulting in POI recommendations. The explosive growth of network geographic resources has led to a dramatic increase in demand for POI recommendations, promoting their explosive growth, and providing valuable geographic information to service providers and users. In view of the increasing demand for real-time and personalization from business scenarios, the next POI recommendation is attracting wide attention in academia and industry. Along with the maturation of space-time big data, the internet of things, deep learning technology and the like, point of interest (POI) recommendation is rapidly developed. In POI recommendation, there is a strong temporal and spatial correlation between sign-on data, and the conventional recommendation method makes capturing user preferences a great challenge due to the individuality and complexity of the user preferences. Moreover, how to consider the geographical dependency relationship between global POI nodes is also a direction of urgent research.
POI (Point of Interest) recommends refer to recommending surrounding or interesting places to the user based on the user's location information and historical behavior. Such a recommendation system may help a user find new places, plan travel routes, find surrounding service facilities, etc. In the process of making recommendations, there are mainly two problems: firstly, a global POI map is constructed by adopting a GNN-based method. However, GNN-based approaches are limited by the inherent limitations of fixed graphs: namely, the construction of the input graph is limited by priori knowledge, and the selection of the statistical indexes leads to incomplete graph structure and noise to a certain extent, so that the performance of characterization learning is restricted; secondly, it is: existing future preference methods ignore interactions of attribute features, particularly spatio-temporal information. Personal access is affected not only by the user's travel plan, but also by the spatiotemporal relationship between the different POIs. Ignoring the spatiotemporal weighted information would consider all historic check-in behavior as a unified contribution, thereby weakening the ability to construct other side information features.
In recent years, deep learning has been attracting attention because of its ability to model data in a high-dimensional nonlinear manner, and has achieved good results in recommendation systems. But mostly rely on a predefined adjacency matrix based on priori knowledge as the basis for global graph construction, and the graph structure is not well processed by only relying on the graph neural network and the predefined adjacency matrix. How to handle efficient modeling and related space-time coding of long-time-ordered data is also a problem to be solved in dealing with user future preferences. The existing models do not adequately consider how to learn and learn the user's future preferences using the adaptive graph to model the user's final preferences, resulting in recommendations.
Disclosure of Invention
Existing POI recommendation methods mostly rely on GNN graph convolution networks and static construction of POI global graphs, but GNN-based methods are limited by inherent limitations of fixed graphs: namely, the construction of the input graph is limited by priori knowledge, the selection of statistical indexes leads to a certain degree of graph structural incompleteness and noise, and the performance of characterization learning is restricted, so that we propose to solve the problem by using the adaptive graph, learn the adjacency matrix of the adaptive graph through similarity measurement, and automatically deduce the potential geographic relation among POIs. Meanwhile, the existing future preference recommendation method mainly does not consider space-time coding, and in order to solve the problems, the invention aims to provide a next POI recommendation method based on adaptive graph learning and future preference.
In order to achieve the above purpose, the invention adopts the following technical scheme:
A next interest point recommending method based on an adaptive graph and future preference comprises the following steps:
Step 1, preparing a historical sign-on dataset of a user, wherein the historical dataset comprises data values such as longitude and latitude of a sign-on place, category of the sign-on place, time of the sign-on place and the like, establishing a preprocessing method, constructing a historical sign-on track of the user and an initial interest point adjacent matrix, and obtaining initial input data.
In the step 1, we use three real data sets from new york city, phoenix city and singapore, each data set includes sign-on time, sign-on location category, sign-on user id, etc., taking singapore city as an example, the data set includes 8648 users, 33172 interest points 355337 sign-on data, sparsity of the data set is 0.12%, time information in the data is selected, including hours and whether it is workday, category information, longitude and latitude information, and user information as main characteristic values, and recommendation sequence of next interest point is predicted.
Step 2, constructing a final embedding expression of the interest points, inputting the final embedding expression as an initial embedding vector of the interest points, utilizing the initial embedding expression of the POI, taking cosine similarity as a measurement function, learning an adjacent matrix of the self-adaptive graph through similarity measurement, automatically deducing potential geographic relation between the interest points, introducing a threshold value to carry out sparsification processing on the graph, and carrying out convolution aggregation on neighborhood information on the basis to obtain the final embedding expression of the interest pointsAnd as a subsequent input.
In the step2, the overall structure of the adaptive graph learning is as follows:
wherein we initialize an initial embedded representation of a global POI D id denotes the feature dimension, and then the dependency between each pair of POIs is inferred by computing the embedded similarity between the two POIs. Using cosine similarity as a metric function, each entry a i,j in the adjacency matrix a, which is a fully connected graph, a i,j e (-1, 1), is finally obtained, and the entries based on the adaptive graph in the matrix reflect an accurate estimate of the geographic dependency between points of interest. But this result can lead to excessive trivial edges, creating a noisy structure. Therefore, a threshold is introduced to perform graphics sparsification, so as to perfect dynamic characteristics related to spatial dependence, to obtain a non-negative adjacency matrix A i,j E (0, 1), and to enhance expressive force of interest points, neighborhood information is aggregated, and initial characteristics of nodes in the graph are convolved, wherein the expression is as follows:
Acquiring a high-order representation of a point of interest UsingAs the final embedded representation of the point of interest.
Step 3, constructing long-term preference of usersThe input is the historical track data of the user within n-1 days, which is composed of the input data x obtained by connecting the final embedded expression of the interest point and the initial embedded expression of other side informationWherein the method comprises the steps ofRepresenting a single-day user track formed by a plurality of embedded data, then constructing a space interval matrix and a time interval matrix of the user embedded track, and encoding the space-time interval matrix to obtain space-time weight omega T,ωD. Secondly, by using a self-attention mechanism, track data in a specific number of days of a user is used as input to obtain association weights among nodes, and long-term preference of the user is obtained
In the step 3, the overall structure of the long-term preference encoder is as follows:
Wherein the user history track The sign-in point data of the user on the same day is obtained, and the sign-in record of each user in the sequence has three characteristics: user id u, POI representationCategory id c. Furthermore, since POIs are closely related to time information, we add two new time information T to capture user activities at a specific time, e.g. people like to go to parks on holidays, go to bars at night. Thus, the two pieces of time information are a weekly id feature t d containing 2 categories and an hourly id feature t h containing 24 categories, respectively. The embedding layer converts each id feature into a d id -dimensional dense vector, which is represented as a feature dimension, and then the pooling layer embeds and merges all five into check-in data x in the generated sequence, the formula is as follows:
The dimension of x is d h=5did and the trace is expressed as Where m is the total number of checked-ins in the whole track.
Then, considering that the user long-term preference modeling is affected by the spatio-temporal environment, we consider the effect of the spatio-temporal weights when designing the long-term preference encoder. We note the space-time interval between two registration points p i,pj as Δt i,j,ΔDi,j, respectively. The time impact weight and the distance impact weight are denoted as W T(ΔTi,j),WDΔDi,j, respectively, specifically we use Havercosine periodic function to capture user time period data and set the time decay weight as follows:
Wperiod(ΔTi,j)=hvc(2πΔTi,j)
Where α is the time decay rate, the rate at which the control weight decreases over the time interval ΔT i,j.
From a spatial perspective, we consider that the closer the POI is to the current location, the more helpful the location prediction. The more helpful the position prediction. The distance exponential decay weight thus represents:
where β is the time decay rate, controlling the rate at which the weight decreases with distance interval Δd i,j.
Finally, we use self-attention mechanism to encode long-term preference, the long-term preference is obtained by fusing multiple side information and time-space information, the formula is as follows:
Wherein the method comprises the steps of All belonging to the transformation weight matrix.
Step 4, constructing a user long-term preference H short which is input as a history track of the user on the same dayShort-term preferences H short for the user are constructed using a long-term memory recurrent neural network LSTM.
In the step 4, the overall structure of the short-term preference H short is as follows:
The input is the historical track of the user on the same day, and the short-term preference encoder captures the time perception sequence dependency of the user from the current sign-in behavior of the user to obtain the short-term preference of the user as H short.
The calculation of the short-term preference encoder may be defined as follows:
we use the current trajectory S short=(x1,x1,...xm) as input data to feed into LSTM network as follows:
wherein, AndThe hidden states of time stamps t i and t i-1, respectively.
Step 5, constructing user future preference, considering self-activity plan of the user, introducing attention mechanism, embedding expression as query vector through future time, taking hidden state matrix of long-term preference as content vector, extracting potential future behavior from daily periodic behavior of the user, obtaining future time preference weight, which implicitly simulates activity schedule of the userCombining the obtained time preference weight with short-term preference H short, embedding the user as a query vector to obtain user future preference H f, and learning probability distribution of the user preference to obtain a final prediction result.
In the step 5, the overall structure of the future preference H f is as follows:
wherein input X is a future time preference weight obtained by fusing future behavior with long-term encoding Because of the consideration that the user may have a self-activity plan when going out, time-aware attention may be used to identify the behavior in the past long-term trajectory that is most relevant to the future time context, in particular, the user long-term trajectoryIs encoded asThe state matrix is hidden and future time preference weights are obtained by extracting potential future behaviors from the user's daily periodic behaviors. Using the future time embedded t k+1 as a query vector, the formula is as follows:
the weights are then combined with short-term preferences by means of a connection to generate hidden states characterizing the user preferences The final future preference of the user is determined byIs summarized, so the final future preference of the user is:
where u represents the user embedded representation. We then learn the probability distribution of the user preferences, decoding the points of interest:
Wherein the method comprises the steps of Is a transformation matrix.
Drawings
FIG. 1 is an overall block diagram of adaptive graph learning in the present invention;
FIG. 2 is an overall block diagram of a medium and long term preference encoder of the present invention;
FIG. 3 is an overall block diagram of constructing a short-term preference encoder in accordance with the present invention;
FIG. 4 is an overall block diagram of a user's future preferences in the present invention;
FIG. 5 is an overall block diagram of a model in the present invention;
Detailed Description
The present invention will be further explained below with reference to the drawings in the embodiments of the present invention.
The invention discloses a next interest point recommending method based on an adaptive graph and future preference, which comprises the following steps:
Step 1, preparing a historical sign-on dataset of a user, wherein the historical dataset comprises data values such as longitude and latitude of a sign-on place, category of the sign-on place, time of the sign-on place and the like, establishing a preprocessing method, constructing a historical sign-on track of the user and an initial interest point adjacent matrix, and obtaining initial input data.
Step 2, constructing a final embedding expression of the interest points, inputting the final embedding expression as an initial embedding vector of the interest points, utilizing the initial embedding expression of the POI, taking cosine similarity as a measurement function, learning an adjacent matrix of the self-adaptive graph through similarity measurement, automatically deducing potential geographic relation between the interest points, introducing a threshold value to carry out sparsification processing on the graph, and carrying out convolution aggregation on neighborhood information on the basis to obtain the final embedding expression of the interest pointsAnd as a subsequent input.
Step 3, constructing long-term preference of usersThe input is the historical track data of the user within n-1 days, which is composed of the input data x obtained by connecting the final embedded expression of the interest point and the initial embedded expression of other side informationWherein the method comprises the steps ofRepresenting a single-day user track formed by a plurality of embedded data, then constructing a space interval matrix and a time interval matrix of the user embedded track, and encoding the space-time interval matrix to obtain space-time weight omega T,ωD. Secondly, by using a self-attention mechanism, track data in a specific number of days of a user is used as input to obtain association weights among nodes, and long-term preference of the user is obtained
Step 4, constructing a user long-term preference H short which is input as a history track of the user on the same dayShort-term preferences H short for the user are constructed using a long-term memory recurrent neural network LSTM.
Step 5, constructing user future preference, considering self-activity plan of the user, introducing attention mechanism, embedding expression as query vector through future time, taking hidden state matrix of long-term preference as content vector, extracting potential future behavior from daily periodic behavior of the user, obtaining future time preference weight, which implicitly simulates activity schedule of the userCombining the obtained time preference weight with short-term preference H short, embedding the user as a query vector to obtain user future preference H f, and learning probability distribution of the user preference to obtain a final prediction result.
In the step 1, we use three real data sets from new york city, phoenix city and singapore, each data set includes sign-on time, sign-on location category, sign-on user id, etc., taking singapore city as an example, the data set includes 8648 users, 33172 interest points 355337 sign-on data, sparsity of the data set is 0.12%, time information in the data is selected, including hours and whether it is workday, category information, longitude and latitude information, and user information as main characteristic values, and recommendation sequence of next interest point is predicted.
In the step 2, please refer to fig. 1 for the overall structure of the adaptive graph learning, the overall structure of the adaptive graph learning is as follows:
wherein we initialize an initial embedded representation of a global POI D id denotes the feature dimension, and then the dependency between each pair of POIs is inferred by computing the embedded similarity between the two POIs. Using cosine similarity as a metric function, each entry a i,j in the adjacency matrix a, which is a fully connected graph, a i,j e (-1, 1), is finally obtained, and the entries based on the adaptive graph in the matrix reflect an accurate estimate of the geographic dependency between points of interest. But this result can lead to excessive trivial edges, creating a noisy structure. Therefore, a threshold is introduced to perform graphics sparsification, so as to perfect dynamic characteristics related to spatial dependence, to obtain a non-negative adjacency matrix A i,j E (0, 1), and to enhance expressive force of interest points, neighborhood information is aggregated, and initial characteristics of nodes in the graph are convolved, wherein the expression is as follows:
Acquiring a high-order representation of a point of interest UsingAs the final embedded representation of the point of interest.
In the step 3, please refer to fig. 2 for the overall structure of the long-term preference encoder, and the long-term preference encoder is integrated
The body structure is as follows:
Wherein the user history track The sign-in point data of the user on the same day is obtained, and the sign-in record of each user in the sequence has three characteristics: user id u, POI representationCategory id c. Furthermore, since POIs are closely related to time information, we add two new time information T to capture user activities at a specific time, e.g. people like to go to parks on holidays, go to bars at night. Thus, the two pieces of time information are a weekly id feature t d containing 2 categories and an hourly id feature t h containing 24 categories, respectively. The embedding layer converts each id feature into a d id -dimensional dense vector, which is represented as a feature dimension, and then the pooling layer embeds and merges all five into check-in data x in the generated sequence, the formula is as follows:
The dimension of x is d h=5did and the trace is expressed as Where m is the total number of checked-ins in the whole track.
Then, considering that the user long-term preference modeling is affected by the spatio-temporal environment, we consider the effect of the spatio-temporal weights when designing the long-term preference encoder. We note the space-time interval between two registration points p i,pj as Δt i,j,ΔDi,j, respectively. The time impact weight and the distance impact weight are denoted as W T(ΔTi,j),WDΔDi,j, respectively, specifically we use Havercosine periodic function to capture user time period data and set the time decay weight as follows:
Wperiod(ΔTi,j)=hvc(2πΔTi,j)
Where α is the time decay rate, the rate at which the control weight decreases over the time interval ΔT i,j.
Spatially, we consider that the closer a POI is to the current location, the more helpful it is in location prediction
Large. The more helpful the position prediction. The distance exponential decay weight thus represents:
where β is the time decay rate, controlling the rate at which the weight decreases with distance interval Δd i,j.
Finally, we use self-attention mechanism to encode long-term preference, which fuses multiple side messages
The information and the air information are obtained by the following formula:
Wherein the method comprises the steps of All belonging to the transformation weight matrix.
In the step 4, referring to fig. 3, the short-term preference encoder overall structure is shown in the short-term preference H short overall structure
The structure is as follows:
The input is the historical track of the user on the same day, and the short-term preference encoder captures the time perception sequence dependency of the user from the current sign-in behavior of the user to obtain the short-term preference of the user as H short.
The calculation of the short-term preference encoder may be defined as follows:
we use the current trajectory S short=(x1,x1,...xm) as input data to feed into LSTM network as follows:
wherein, AndThe hidden states of time stamps t i and t i-1, respectively.
In the step 5, referring to fig. 4, the overall structure of the future preference H f is as follows:
wherein input X is a future time preference weight obtained by fusing future behavior with long-term encoding Because of the consideration that the user may have a self-activity plan when going out, time-aware attention may be used to identify the behavior in the past long-term trajectory that is most relevant to the future time context, in particular, the user long-term trajectoryIs encoded asThe state matrix is hidden and future time preference weights are obtained by extracting potential future behaviors from the user's daily periodic behaviors. Using the future time embedded t k+1 as a query vector, the formula is as follows:
the weights are then combined with short-term preferences by means of a connection to generate hidden states characterizing the user preferences The final future preference of the user is determined byIs summarized, so the final future preference of the user is:
where u represents the user embedded representation. We then learn the probability distribution of the user preferences, decoding the points of interest:
Wherein the method comprises the steps of Is a transformation matrix.
In the invention, in the aspect of data set processing, unlike a general flow prediction algorithm, the real traffic flow data set is adopted as training, so that the real availability of the algorithm is enhanced; in the aspect of network structure, the invention uses a multi-head attention spread graph convolution network to dynamically simulate traffic flow mode, thereby enhancing the accuracy of traffic flow prediction; in the aspect of predicting the target, the method selects the traffic flow prediction in the short-term time in the future as the target, so that the prediction content of the method is more accurate and real-time. Experiments show that the model provided by the method can basically realize effective prediction of traffic flow, and the finally obtained effect has authenticity.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.