CN115510333A - A POI Prediction Method Based on Spatio-Temporal Awareness Combining Local and Global Preferences - Google Patents
A POI Prediction Method Based on Spatio-Temporal Awareness Combining Local and Global Preferences Download PDFInfo
- Publication number
- CN115510333A CN115510333A CN202211176462.XA CN202211176462A CN115510333A CN 115510333 A CN115510333 A CN 115510333A CN 202211176462 A CN202211176462 A CN 202211176462A CN 115510333 A CN115510333 A CN 115510333A
- Authority
- CN
- China
- Prior art keywords
- user
- poi
- follows
- historical
- feature
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000012549 training Methods 0.000 claims abstract description 31
- 230000004927 fusion Effects 0.000 claims abstract description 19
- 230000008447 perception Effects 0.000 claims abstract description 11
- 230000006870 function Effects 0.000 claims description 43
- 239000011159 matrix material Substances 0.000 claims description 37
- 238000004364 calculation method Methods 0.000 claims description 18
- 238000012545 processing Methods 0.000 claims description 13
- 230000004913 activation Effects 0.000 claims description 12
- 238000013507 mapping Methods 0.000 claims description 9
- 238000013528 artificial neural network Methods 0.000 claims description 6
- 238000010606 normalization Methods 0.000 claims description 6
- 230000003044 adaptive effect Effects 0.000 claims description 5
- 230000002123 temporal effect Effects 0.000 claims description 4
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000011478 gradient descent method Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 claims description 3
- 238000002474 experimental method Methods 0.000 description 22
- 230000000694 effects Effects 0.000 description 10
- 230000007774 longterm Effects 0.000 description 10
- 238000011156 evaluation Methods 0.000 description 8
- 230000006399 behavior Effects 0.000 description 4
- 238000002679 ablation Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005065 mining Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000003442 weekly effect Effects 0.000 description 2
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9536—Search customisation based on social or collaborative filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9537—Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本发明涉及一种基于时空感知并结合局部和全局偏好的POI预测方法,包括如下步骤:S1:选用公开签入POIs数据集作为训练集,该训练集包括用户历史POI轨迹序列;S2:构建POI预测模型LGSA,LGSA包括局部特征模块、全局特征模块和特征融合模块;S3:利用局部特征模块和全局特征模块计算用户历史POI轨迹序列的Locu和Glou;S4:设置初始权重系数α,使用特征融合模块将Locu和Glou进行结合得到总偏好特征Cu;S5:利用总偏好特征Cu预测得到用户的下一个兴趣点。使用本发明模型可以进一步提高对POI预测的准确性。
The present invention relates to a POI prediction method based on spatio-temporal perception combined with local and global preferences, comprising the following steps: S1: select a publicly checked-in POIs data set as a training set, the training set includes user historical POI trajectory sequences; S2: construct POI Prediction model LGSA, LGSA includes local feature module, global feature module and feature fusion module; S3: use local feature module and global feature module to calculate Loc u and Glo u of the user's historical POI trajectory sequence; S4: set the initial weight coefficient α, use The feature fusion module combines Loc u and Glo u to obtain the total preference feature C u ; S5: Use the total preference feature C u to predict and obtain the user's next point of interest. Using the model of the present invention can further improve the accuracy of POI prediction.
Description
技术领域technical field
本发明涉及POI预测领域,特别涉及一种基于时空感知并结合局部和全局偏好的POI预测方法。The invention relates to the field of POI prediction, in particular to a POI prediction method based on space-time perception and combining local and global preferences.
背景技术Background technique
随着基于个性化服务平台日益增长,基于位置的社交网络(LBSNs)如Foursquare和Brightkite已经成为一个大众喜爱的社交平台,用户在社交平台留下大量的签入POI,POI即兴趣点,这些数据为用户个性化服务研究提供了数据支撑,下一个地点预测一直是基于位置的个性化服务的一个长期问题,通过历史轨迹对人们出行行为和目的地进行预测可以为个人用户提供更加个性化、智能化的位置服务。例如,通过挖掘用户历史POI轨迹并获得用户偏好可以为用户推荐下一个地点。With the growing number of personalized service platforms, location-based social networks (LBSNs) such as Foursquare and Brightkite have become a popular social platform. Users leave a large number of check-in POIs on social platforms. POIs are points of interest. It provides data support for user personalized service research. The next location prediction has always been a long-term problem for location-based personalized services. Predicting people's travel behavior and destinations through historical trajectories can provide individual users with more personalized and intelligent services. optimized location services. For example, by mining the user's historical POI trajectory and obtaining user preferences, the next location can be recommended for the user.
在POI预测问题中,用户的兴趣点签入受时间、地理、兴趣点类别和长期偏好等多种因素影响;其中,地理距离会影响用户连续签入地点的范围,因为用户更倾向于选择兴趣点之间地理距离近的多功能区域;在时间维度上,用户会因时间点而签入不同功能的兴趣点,例如中午12点签入的兴趣点普遍是餐厅,下午14:00到17:00签入的兴趣点类别是咖啡厅、电影院等休闲场所。除此之外,用户随时间变化的动态偏好也至关重要,轨迹序列能够反应用户随时间变化的动态偏好和签入地点之间的依赖性。In the POI prediction problem, the user's POI check-in is affected by various factors such as time, geography, POI category, and long-term preference; among them, geographical distance will affect the range of users' continuous check-in locations, because users are more inclined to choose interest A multi-functional area with a short geographical distance between points; in the time dimension, users will check in points of interest with different functions according to the time point. For example, the point of interest checked in at 12:00 noon is generally a restaurant, and from 14:00 to 17:00 in the afternoon The POI categories of 00 check-in are leisure places such as coffee shops and movie theaters. In addition, the user's dynamic preference over time is also crucial, and the trajectory sequence can reflect the dependence between the user's dynamic preference over time and the check-in location.
考虑到上述因素,近年来大多数研究使用循环神经网络(RNNs)或其变体来捕捉用户长期和短期偏好,或者使用时空注意网络来聚合用户历史POI轨迹中所有访问的地点,为了捕获用户长期和短期偏好,Ma等人提出了一个与贝叶斯个性化排名相结合的分层门控网络;随后,Ma等人在原问题上又进一步提出了一种基于记忆增强图神经网络来捕捉用户长期和短期偏好。然而,这两种方法都依赖于浅层的方法,不能有效地捕捉用户随时间变化的动态兴趣,并且忽略了轨迹序列中的地理因素,这类方法导致预测的地点在时间和空间维度上不具有针对性从而降低预测效果;而ST-RNN和STAN都考虑了用户签入POI的时空特征,但忽略了用户的轨迹序列和个性化时空区域,这种方式来预测地点会降低同一个时空区域中地点的强关联性。Considering the above factors, most studies in recent years use recurrent neural networks (RNNs) or its variants to capture users’ long-term and short-term preferences, or use spatio-temporal attention networks to aggregate all visited locations in users’ historical POI trajectories, in order to capture users’ long-term and short-term preferences, Ma et al. proposed a hierarchical gating network combined with Bayesian personalized ranking; subsequently, Ma et al. further proposed a memory-enhanced graph neural network based on the original problem to capture users' long-term and short-run preferences. However, both of these methods rely on shallow methods, which cannot effectively capture the dynamic interests of users over time, and ignore the geographical factors in the trajectory sequence. It is targeted to reduce the prediction effect; while ST-RNN and STAN both consider the spatio-temporal characteristics of the user's check-in POI, but ignore the user's trajectory sequence and personalized spatio-temporal area. This way of predicting the location will reduce the same spatio-temporal area. Strong correlations between locations.
发明内容Contents of the invention
针对现有技术存在的上述问题,本发明要解决的技术问题是:如何提高对POI的预测准确性。In view of the above-mentioned problems existing in the prior art, the technical problem to be solved by the present invention is: how to improve the prediction accuracy of POI.
为解决上述技术问题,本发明采用如下技术方案:一种基于时空感知并结合局部和全局偏好的POI预测方法,包括如下步骤:In order to solve the above technical problems, the present invention adopts the following technical solution: a POI prediction method based on space-time perception and combining local and global preferences, including the following steps:
S100:选用公开签入POIs数据集作为训练集O,该训练集O包括用户历史POI轨迹序列,每个用户的历史POI轨迹序列表示为 表示用户在ts时刻所处的兴趣点;S100: Select the public check-in POIs data set as the training set O, the training set O includes the user's historical POI trajectory sequence, and the historical POI trajectory sequence of each user is expressed as Indicates the point of interest where the user is at time t s ;
所述用户历史POI轨迹按时间顺序排列,所述用户历史POI轨迹序列包括用户标签、时间标签、地点标签和地点标签对应的经纬度;The user's historical POI trajectory is arranged in chronological order, and the user's historical POI trajectory sequence includes a user label, a time label, a location label, and the latitude and longitude corresponding to the location label;
S200:构建POI预测模型LGSA,LGSA包括局部特征模块、全局特征模块和特征融合模块;S200: Construct a POI prediction model LGSA, where the LGSA includes a local feature module, a global feature module, and a feature fusion module;
S300:从训练集O中随机选取一个用户历史POI轨迹序列,计算该用户历史POI轨迹序列的局部特征向量表示和全局特征向量表示:S300: Randomly select a user's historical POI trajectory sequence from the training set O, and calculate the local feature vector representation and global feature vector representation of the user's historical POI trajectory sequence:
S310:将该用户历史POI轨迹序列作为输入,使用局部特征模块计算该用户在时空区域上的局部特征向量表示Locu,表达式如下:S310: Taking the user's historical POI track sequence as input, and using the local feature module to calculate the local feature vector representation Loc u of the user in the space-time region, the expression is as follows:
其中,T表示矩阵转置,avg(·)表示平均函数,ranh(·)表示激活函数,Atl表示注意力分数矩阵,表示细粒度子序列的子序列特征;Among them, T represents the matrix transpose, avg( ) represents the average function, ranh( ) represents the activation function, At l represents the attention score matrix, Represents subsequence features of fine-grained subsequences;
S320:将该用户历史POI轨迹序列作为输入,使用全局特征模块计算该用户在以周为时间单位上的全局特征向量表示Glou,表达式如下:S320: Taking the user's historical POI trajectory sequence as input, and using the global feature module to calculate the user's global feature vector representation Glo u in the time unit of weeks, the expression is as follows:
Glou=LN(Ah+Dropout(PFFN(Ah))); (2)Glo u =LN(A h +Dropout(PFFN(A h ))); (2)
其中,Ah表示特征经过多头注意力后的输出,LN(·)表示神经网络中的层归一化,Dropout(·)表示防止模型过拟合而采用的方法,PFFN(·)表示正向前馈网络;Among them, A h represents the output of the feature after multi-head attention, LN( ) represents the layer normalization in the neural network, Dropout( ) represents the method used to prevent the model from overfitting, PFFN( ) represents the forward feed-forward network;
S400:设置初始权重系数α,使用特征融合模块将Locu和Glou进行结合,通过加权求和将局部特征与全局特征进行融合得到该用户的总偏好特征Cu,具体表达式如下:S400: Set the initial weight coefficient α, use the feature fusion module to combine Loc u and Glo u , and fuse the local features and global features through weighted summation to obtain the user's total preference feature C u , the specific expression is as follows:
Cu=αLocu+(1-α)Clou; (3)C u =αLoc u +(1-α)Clo u ; (3)
其中,α是表示权重系数,α∈[0,1];Among them, α is the weight coefficient, α∈[0,1];
S500:利用总偏好特征Cu计算该用户的预测POI,具体步骤如下:S500: Using the total preference feature C u to calculate the predicted POI of the user, the specific steps are as follows:
S510:计算该用户的预测POI表示向量Pu,表达式如下:S510: Calculate the predicted POI representation vector P u of the user, the expression is as follows:
其中,表示轨迹序列中的地点表示特征,d表示特征维度,t表示时间,Co表示用户时空区域中地点间的特征关系,Co的计算表达式如下:in, Indicates that the location in the trajectory sequence represents the feature, d represents the feature dimension, t represents the time, Co represents the feature relationship between the locations in the user's space-time area, and the calculation expression of Co is as follows:
其中,表示时空区域的子序列表示向量,Wr是可学习的参数;in, The subsequence representation vector representing the space-time region, W r is a learnable parameter;
S520:通过索引映射将Pu映射到POI的地点标签,得到该用户的预测POI;所述索引映射为一个POI地点标签对应一个POI表示向量,两者为一一对应关系;S520: Map Pu to the location label of the POI through index mapping to obtain the predicted POI of the user; the index mapping is that a POI location label corresponds to a POI representation vector, and the two are in a one-to-one correspondence;
S600:利用该用户的预测POI表示向量来计算LGSA模型的目标函数K,具体表达式如下:S600: Using the user's predicted POI representation vector to calculate the objective function K of the LGSA model, the specific expression is as follows:
K=argmin∑(u,pos,neg)∈O-log(σ(Pu,pos-Pu,neg)); (6)K=argmin∑ (u,pos,neg)∈O -log(σ(P u,pos -P u,neg )); (6)
其中,Pu,pos表示真实POI与预测POI表示向量的距离,Pu,neg表示非当前用户轨迹序列中的POI与预测POI表示向量的距离,u表示用户标签,pos表示真实POI标签,neg表示非当前用户轨迹序列中的POI标签,σ表示sigmoid函数;Among them, P u,pos represents the distance between the real POI and the predicted POI representation vector, P u,neg represents the distance between the POI in the non-current user trajectory sequence and the predicted POI representation vector, u represents the user label, pos represents the real POI label, neg Represents the POI label in the non-current user trajectory sequence, and σ represents the sigmoid function;
S700:利用目标函数K作为损失函数对LGSA模型进行训练,同时使用梯度下降法反向更新LGSA模型参数;S700: Using the objective function K as a loss function to train the LGSA model, and using the gradient descent method to reversely update the parameters of the LGSA model;
S800:遍历训练集中所有的用户历史POI轨迹序列,重复步骤S300-S700对模型进行训练,预设训练最大迭代次数,当训练达到最大迭代次数时停止训练,得到训练好的LGSA模型;S800: Traverse all the historical POI trajectory sequences of users in the training set, repeat steps S300-S700 to train the model, preset the maximum number of iterations for training, stop training when the training reaches the maximum number of iterations, and obtain a trained LGSA model;
S900:将待预测用户历史POI轨迹序列作为训练好的LGSA输入,输出为对该待预测用户下一个POI的预测结果。S900: Taking the historical POI trajectory sequence of the user to be predicted as the input of the trained LGSA, and outputting a prediction result of the next POI of the user to be predicted.
作为优选,所述S310中计算每个用户在时空区域上的局部特征向量表示Locu的具体步骤如下:As a preference, the specific steps of calculating the local feature vector representation Loc u of each user in the spatio-temporal region in the S310 are as follows:
S311:随机选取一个用户历史POI轨迹序列,并对该用户历史POI轨迹序列进行时间间隔处理,具体表达式如下:S311: Randomly select a user historical POI trajectory sequence, and perform time interval processing on the user historical POI trajectory sequence, the specific expression is as follows:
其中,表示用户在访问地点i和地点j之间的时间间隔,ti表示在地点i的时间戳,tj表示在地点j的时间戳;in, Indicates the time interval between the user visiting location i and location j, t i indicates the timestamp at location i, and t j indicates the timestamp at location j;
对该用户历史POI轨迹序列进行地理距离处理,具体表达式如下:Perform geographical distance processing on the user's historical POI trajectory sequence, the specific expression is as follows:
其中,表示访问地点i和地点j之间的地理距离,r表示半径,loni和lati表示地点i的GPSi的经纬度,lonj和latj表示地点j的GPSj的经纬度,Haversine(·)表示地理距离函数;in, Indicates the geographical distance between visiting location i and location j, r indicates the radius, lon i and lat i indicate the longitude and latitude of GPS i of location i, lon j and lat j indicate the longitude and latitude of GPS j of location j, Haversine( ) means geographical distance function;
S312:根据时间间隔和地理距离划分该用户历史POI轨迹序列得到时空区域集Regu,具体表达式如下:S312: Divide the user's historical POI trajectory sequence according to the time interval and geographical distance to obtain the space-time region set Reg u , the specific expression is as follows:
Regu={reg1,reg2,…,regx}; (9)Reg u = {reg 1 ,reg 2 ,...,reg x }; (9)
其中,regx表示第x个时空区域,x表示时空区域的数量;Among them, reg x represents the xth space-time region, and x represents the number of space-time regions;
S313:使用滑动窗口w将时空区域集中每个时空区域分割为细粒度子序列,具体表达式如下:S313: Use the sliding window w to divide each spatio-temporal area in the spatio-temporal area set into fine-grained subsequences, the specific expression is as follows:
其中,w表示滑动窗口的大小;Among them, w represents the size of the sliding window;
S314:计算细粒度子序列的子序列特征计算表达式如下:S314: Calculating subsequence features of fine-grained subsequences The calculation expression is as follows:
其中,W1表示可学习参数,Ma∈Rw×d表示自适应邻接矩阵,d表示特征维度,tanh表示激活函数,区域内的子序列嵌入表示为 Among them, W 1 represents the learnable parameters, M a ∈ R w × d represents the adaptive adjacency matrix, d represents the feature dimension, tanh represents the activation function, and the subsequence embedding in the region is expressed as
S315:计算的注意力分数矩阵,计算表达式如下:S315: Calculate The attention score matrix of , the calculation expression is as follows:
其中,Atl表示注意力分数矩阵,W2、W3、b1和b2均表示可学习参数,Softmax表示激活函数;Among them, At l represents the attention score matrix, W 2 , W 3 , b 1 and b 2 all represent learnable parameters, and Softmax represents the activation function;
S316:利用Atl和计算得到该用户在时空区域上的局部特征向量表示Locu;S316: using At l and Calculate and obtain the local feature vector representation Loc u of the user in the spatio-temporal region;
S317:遍历训练集中所有用户历史POI轨迹序列,计算得到每个用户在时空区域上的局部特征向量表示。S317: Traverse all user historical POI trajectory sequences in the training set, and calculate the local feature vector representation of each user in the spatio-temporal region.
此方法可以有效挖掘时空区域子序列中地点自身的特征和其周围关联地点的信息,获得用户在局部特定时空区域范围内的兴趣偏好。This method can effectively mine the characteristics of the location itself in the subsequence of the spatiotemporal region and the information of its surrounding associated locations, and obtain the user's interest preference within the scope of the local specific spatiotemporal region.
作为优选,所述S320中计算用户在时空区域上的全局特征向量表示Glou的具体步骤如下:As a preference, the specific steps of calculating the user's global feature vector representation Glo u in the spatio-temporal region in the S320 are as follows:
S321:随机选取一个用户历史POI轨迹序列,并将该用户历史POI轨迹序列中的时间信息进行融合,计算表达式如下:S321: Randomly select a user's historical POI trajectory sequence, and fuse the time information in the user's historical POI trajectory sequence, and the calculation expression is as follows:
其中,表示完成时间信息融合后的用户历史POI轨迹序列,W4表示可学习参数,表示轨迹序列与特殊时间周期的拼接向量;in, Indicates the user's historical POI trajectory sequence after time information fusion is completed, W 4 indicates the learnable parameters, A concatenated vector representing a sequence of trajectories and a special time period;
S322:计算的非侵入式的自注意力计算表达式如下:S322: Calculate non-intrusive self-attention The calculation expression is as follows:
其中,N表示有N层多头注意力网络层,Attention(·)表示注意力函数,Q、K、V分别是从和Su映射得到的可学习矩阵,KT表示K的转置矩阵,σ表示可学习的参数;Among them, N means that there are N layers of multi-head attention network layers, Attention(·) means the attention function, Q, K, and V are respectively from The learnable matrix obtained by mapping with S u , K T represents the transpose matrix of K, and σ represents the learnable parameters;
S323:计算N层多头注意力,计算表达式如下:S323: Calculate N-layer multi-head attention, the calculation expression is as follows:
其中,是第y层多头注意力网络层,Ah是多头注意力层的输出,GWLU表示高斯误差线性单元,W5、W6、b5、和b6表示可学习参数;in, is the multi-head attention network layer of the y-th layer, A h is the output of the multi-head attention layer, GWLU represents a Gaussian error linear unit, and W 5 , W 6 , b 5 , and b 6 represent learnable parameters;
S324:对各子层的输出进行层归一化处理和dropout函数处理,得到该用户在时空区域上的全局特征向量表示Glou;S324: Perform layer normalization processing and dropout function processing on the output of each sub-layer, and obtain the global feature vector representation Glo u of the user in the spatio-temporal region;
S325:遍历训练集中所有用户历史POI轨迹序列,计算得到每个用户在时空区域上的全局特征向量表示。S325: Traverse all user historical POI trajectory sequences in the training set, and calculate the global feature vector representation of each user in the spatio-temporal region.
该方法关注用户动态序列即全局特征可以有效捕获用户行为随时间变化的动态偏好和长期语义,并挖掘轨迹序列中相关地点。This method focuses on the user's dynamic sequence, that is, the global feature, which can effectively capture the dynamic preference and long-term semantics of user behavior over time, and mine relevant locations in the trajectory sequence.
作为优选,所述S321中进行时间信息融合的具体步骤如下:As a preference, the specific steps for performing time information fusion in S321 are as follows:
S321-1:每个用户的历史轨迹序列为用户历史POI轨迹序列中的特殊时间模式,其中,表示轨迹序列中的地点表示向量,ti表示特殊时间周期的表示向量,u表示用户,week表示以周为单位的特殊时间周期;S321-1: The historical trajectory sequence of each user is Special temporal patterns in the sequence of user historical POI trajectories, in, Represents the location representation vector in the trajectory sequence, t i represents the representation vector of a special time period, u represents the user, and week represents the special time period in weeks;
S321-2:根据时间单位换算,将POI签入时间换算成以周为单位的特殊时间周期,得到特殊时间周期的嵌入矩阵 S321-2: According to the time unit conversion, convert the POI check-in time into a special time period in weeks, and obtain the embedded matrix of the special time period
根据word2vec词嵌入方法计算轨迹序列的嵌入矩阵E(Su);Calculate the embedding matrix E(S u ) of the trajectory sequence according to the word2vec word embedding method;
S321-3:将和E(Su)在特征维度上进行拼接,得到拼接矩阵具体表达式如下:S321-3: will and E(S u ) are spliced on the feature dimension to get the splicing matrix The specific expression is as follows:
其中,con(·)表示拼接函数;Among them, con( ) represents the splicing function;
S321-4:利用激活函数对进行处理,得到完成时间信息融合后的用户历史POI轨迹序列 S321-4: Use the activation function pair Process to obtain the user's historical POI trajectory sequence after time information fusion
局部特征包含了学习了用户在时空区域的POIs之间的依赖关系,全局特征可以获得用户对特殊时间段的动态偏好,所以结合局部特征和全局特征可以在考虑轨迹序列的基础上,更有效地在时空层面上捕获用户的行为偏好。Local features include learning the dependencies between POIs of the user in the spatio-temporal region, and global features can obtain the user's dynamic preference for a special time period, so combining local features and global features can be considered on the basis of trajectory sequences. Capturing user behavior preferences at the spatio-temporal level.
相对于现有技术,本发明至少具有如下优点:Compared with the prior art, the present invention has at least the following advantages:
1.本发明公开了一种基于时空感知并结合局部和全局偏好的POI预测方法,用于下一个POI预测。根据地理距离和时间间隔,将每个用户的轨迹序列划分为个性化的时空区域,并从局部视图中学习用户在签到区域中POIs之间的依赖性。此外,利用时间信息融合以细粒度时间为一周来挖掘用户随时间变化的动态偏好,因为周变化周期特征能够很好的反应用户历史轨迹在每周特定的活动;利用一种非侵入性的方式来融合用户的轨迹序列和序列的时间段,并从全局视图中挖掘用户对该时间段的动态偏好。最后将局部特征和全局特征进行特征融合得到总偏好特征,最终利用总偏好特征得到用户的下一个POI预测点。1. The present invention discloses a POI prediction method based on spatiotemporal perception combined with local and global preferences for next POI prediction. According to the geographic distance and time interval, each user's trajectory sequence is divided into personalized spatio-temporal regions, and the user's dependencies among POIs in the check-in region are learned from the local view. In addition, time information fusion is used to mine the user's dynamic preferences over time with fine-grained time as a week, because the weekly change period feature can well reflect the specific activities of the user's historical track in each week; using a non-invasive way To fuse the user's trajectory sequence and the time period of the sequence, and mine the user's dynamic preference for the time period from the global view. Finally, the local feature and the global feature are fused to obtain the total preference feature, and finally the user's next POI prediction point is obtained by using the total preference feature.
2.本发明提出了LGSA模型,基于用户历史POI轨迹序列从局部(即个性化的时空区域)和全局(即带有时间周期的轨迹序列)视图中学习用户偏好。2. The present invention proposes an LGSA model to learn user preferences from local (i.e., personalized spatio-temporal regions) and global (i.e., trajectory sequences with time periods) views based on user historical POI trajectory sequences.
3.为了有效地学习时空区域中的局部依赖关系,本发明提出了个性化的时空感知区域,根据轨迹序列中的地理距离和时间间隔为每一位用户划分个性化时空区域,从局部视图学习用户在时空区域中签入POIs之间的依赖关系,这种方式可以降低轨迹序列中在不同时空区域上POI的相关性,从而提高预测结果。3. In order to effectively learn the local dependencies in the spatio-temporal region, the present invention proposes a personalized spatio-temporal perception region, divides the personalized spatio-temporal region for each user according to the geographical distance and time interval in the trajectory sequence, and learns from the local view The user checks in the dependency between POIs in the spatiotemporal region, which can reduce the correlation of POIs in different spatiotemporal regions in the trajectory sequence, thereby improving the prediction results.
4.为了充分整合轨迹序列和个性化的时间段,本发明使用非侵入式的方式融合用户的轨迹序列和序列的时间周期,从全局视图挖掘用户动态偏好和轨迹序列在时间周期上POI时序性,这种方式既不会覆盖轨迹信息,又可以很好的提取轨迹序列与周变化周期的关系。4. In order to fully integrate the trajectory sequence and the personalized time period, the present invention uses a non-intrusive method to fuse the user's trajectory sequence and the time period of the sequence, and mine the user's dynamic preferences and the POI timing of the trajectory sequence in the time period from the global view , this method will neither cover the trajectory information, but also can extract the relationship between the trajectory sequence and the weekly change period very well.
附图说明Description of drawings
图1为本发明中包含局部特征和全局特征的LGSA结构框架图。Fig. 1 is a frame diagram of the LGSA structure including local features and global features in the present invention.
图2为本发明中使用时间间隔和地理距离划分时空区域示意图。FIG. 2 is a schematic diagram of dividing space-time regions using time intervals and geographic distances in the present invention.
图3为本发明实验中在NYC数据集上的性能比较。Fig. 3 is the performance comparison on the NYC dataset in the experiment of the present invention.
图4为本发明实验中在TKY数据集上的性能比较。Fig. 4 is the performance comparison on the TKY data set in the experiment of the present invention.
图5为本发明实验中在Brightkite数据集上的性能比较。Fig. 5 is the performance comparison on the Brightkite data set in the experiment of the present invention.
图6为本发明实验中批处理参数实验。Fig. 6 is the batch processing parameter experiment in the experiment of the present invention.
图7为本发明实验中时空阈值参数实验。Fig. 7 is an experiment of spatiotemporal threshold parameters in the experiment of the present invention.
具体实施方式detailed description
下面对本发明作进一步详细说明。The present invention will be described in further detail below.
本发明公开了基于时空感知的基础上,结合局部和全局偏好,用于下一个POI预测。根据个性化时空区域中POI之间的依赖性提出局部偏好模块;然后,对全局偏好进行建模来挖掘用户在特定时间段上的动态偏好;对偏好聚合进行建模能有效地融合局部特征和全局特征,从而完成POI预测。The present invention discloses a combination of local and global preferences based on spatio-temporal perception for next POI prediction. A local preference module is proposed according to the dependence between POIs in the personalized spatio-temporal region; then, the global preference is modeled to mine the user's dynamic preference in a specific time period; modeling the preference aggregation can effectively fuse local features and Global features to complete POI prediction.
参见图1-图2,一种基于时空感知并结合局部和全局偏好的POI预测方法,包括如下步骤:See Figure 1-Figure 2, a POI prediction method based on space-time perception and combining local and global preferences, including the following steps:
S100:选用公开签入POIs数据集作为训练集O,该训练集O包括用户历史POI轨迹序列,每个用户的历史POI轨迹序列表示为 表示用户在ts时刻所处的兴趣点;S100: Select the public check-in POIs data set as the training set O, the training set O includes the user's historical POI trajectory sequence, and the historical POI trajectory sequence of each user is expressed as Indicates the point of interest where the user is at time t s ;
所述用户历史POI轨迹按时间顺序排列,所述用户历史POI轨迹序列包括用户标签、时间标签、地点标签和地点标签对应的经纬度;The user's historical POI trajectory is arranged in chronological order, and the user's historical POI trajectory sequence includes a user label, a time label, a location label, and the latitude and longitude corresponding to the location label;
S200:构建POI预测模型LGSA,LGSA包括局部特征模块、全局特征模块和特征融合模块;S200: Construct a POI prediction model LGSA, where the LGSA includes a local feature module, a global feature module, and a feature fusion module;
S300:从训练集O中随机选取一个用户历史POI轨迹序列,计算该用户历史POI轨迹序列的局部特征向量表示和全局特征向量表示:S300: Randomly select a user's historical POI trajectory sequence from the training set O, and calculate the local feature vector representation and global feature vector representation of the user's historical POI trajectory sequence:
S310:将该用户历史POI轨迹序列作为输入,使用局部特征模块计算该用户在时空区域上的局部特征向量表示Locu,表达式如下:S310: Taking the user's historical POI track sequence as input, and using the local feature module to calculate the local feature vector representation Loc u of the user in the space-time region, the expression is as follows:
其中,T表示矩阵转置,avg(·)表示平均函数,tanh(·)表示激活函数,Atl表示注意力分数矩阵,表示细粒度子序列的子序列特征;Among them, T represents the matrix transpose, avg( ) represents the average function, tanh( ) represents the activation function, At l represents the attention score matrix, Represents subsequence features of fine-grained subsequences;
所述S310中计算每个用户在时空区域上的局部特征向量表示Locu的具体步骤如下:The specific steps of calculating the local feature vector representation Loc u of each user in the space-time region in the S310 are as follows:
S311:随机选取一个用户历史POI轨迹序列,并对该用户历史POI轨迹序列进行时间间隔处理,具体表达式如下:S311: Randomly select a user historical POI trajectory sequence, and perform time interval processing on the user historical POI trajectory sequence, the specific expression is as follows:
其中,表示用户在访问地点i和地点j之间的时间间隔,ti表示在地点i的时间戳,tj表示在地点j的时间戳;in, Indicates the time interval between the user visiting location i and location j, t i indicates the timestamp at location i, and t j indicates the timestamp at location j;
对该用户历史POI轨迹序列进行地理距离处理,具体表达式如下:Perform geographical distance processing on the user's historical POI trajectory sequence, the specific expression is as follows:
其中,表示访问地点i和地点j之间的地理距离,r表示半径,loni和lati表示地点i的GPSi的经纬度,lonj和latj表示地点j的GPSj的经纬度,Haversine(·)表示地理距离函数;in, Indicates the geographical distance between visiting location i and location j, r indicates the radius, lon i and lat i indicate the longitude and latitude of GPS i of location i, lon j and lat j indicate the longitude and latitude of GPS j of location j, Haversine( ) means geographical distance function;
S312:根据时间间隔和地理距离划分该用户历史POI轨迹序列得到时空区域集Regu,具体表达式如下:S312: Divide the user's historical POI trajectory sequence according to the time interval and geographical distance to obtain the space-time region set Reg u , the specific expression is as follows:
Regu={reg1,reg2,…,regx}; (9)Reg u = {reg 1 ,reg 2 ,...,reg x }; (9)
其中,regx表示第x个时空区域,x表示时空区域的数量;Among them, reg x represents the xth space-time region, and x represents the number of space-time regions;
轨迹序列中的地点间的时间间隔以分钟为单位,将时间间隔阈值θt和地理距离阈值θg均用来划分时空区域;具体的,计算轨迹序列的时间间隔和地理距离,并将其不同的中值分别设为划分时空区域的阈值;因此,每个序列得到不同数量的时空区域,本发明中时空区域被认为是局部特征。The time interval between locations in the trajectory sequence is in minutes, and both the time interval threshold θ t and the geographic distance threshold θ g are used to divide the space-time region; specifically, the time interval and geographic distance of the trajectory sequence are calculated and different The median value of is respectively set as the threshold for dividing spatio-temporal regions; therefore, each sequence gets a different number of spatio-temporal regions, which are considered as local features in the present invention.
S313:使用滑动窗口w将时空区域集中每个时空区域分割为细粒度子序列,滑动窗口为现有已知的实验策略,具体表达式如下:S313: Use the sliding window w to divide each spatiotemporal region in the spatiotemporal region set into fine-grained subsequences. The sliding window is an existing known experimental strategy, and the specific expression is as follows:
其中,w表示滑动窗口的大小;这种实验策略可以帮助模型更加关注时空区域内相邻签入地点之间的联系,而忽略不相关的影响力小的地点;对每一位用户,都有对应的时空区域集,对用户的每一个时空区域使用滑动窗口生成子序列集,子序列集的个数由滑动窗口的大小决定。Among them, w represents the size of the sliding window; this experimental strategy can help the model pay more attention to the connection between adjacent check-in locations in the spatio-temporal region, while ignoring irrelevant locations with little influence; for each user, there are For the corresponding spatiotemporal region set, a sliding window is used to generate a subsequence set for each spatiotemporal region of the user, and the number of subsequence sets is determined by the size of the sliding window.
S314:计算细粒度子序列的子序列特征计算表达式如下:S314: Calculating subsequence features of fine-grained subsequences The calculation expression is as follows:
其中,W1表示可学习参数,Ma∈Rw×d表示自适应邻接矩阵,d表示特征维度,tanh表示激活函数,该激活函数被用来使矩阵的取值范围从-1到1;区域内的子序列嵌入表示为由于子序列不是GNN建模的固有图,因此需要构建一个图来捕获位置之间的连接,在子序列中的位置之间添加边,计算所有用户中提取的项目对的边数并建立自适应邻接矩阵,根据边数对邻接矩阵进行归一化,这个自适应邻接矩阵可以自动学习区域中子序列地点间的依赖关系。Among them, W 1 represents the learnable parameters, M a ∈ R w × d represents the adaptive adjacency matrix, d represents the feature dimension, tanh represents the activation function, which is used to make the value of the matrix range from -1 to 1; The subsequence embedding within a region is expressed as Since subsequences are not inherent graphs modeled by GNNs, a graph needs to be built to capture connections between locations, add edges between locations in a subsequence, count the number of edges for item pairs extracted in all users, and build an adaptive Adjacency matrix, which normalizes the adjacency matrix according to the number of edges, this adaptive adjacency matrix can automatically learn the dependencies between subsequence locations in the region.
S315:计算的注意力分数矩阵,计算表达式如下:S315: Calculate The attention score matrix of , the calculation expression is as follows:
其中,Atl表示注意力分数矩阵,W2、W3、b1和b2均表示可学习参数,Softmax表示激活函数;此处使用了两层GNN来聚合信息,这是为了很好的挖掘时空区域中的子序列其自身的特征和其周围地点的信息;注意力分数矩阵可以为每个地点分配注意力权重,提取用户在局部区域更关注的地点。Among them, At l represents the attention score matrix, W 2 , W 3 , b 1 and b 2 all represent learnable parameters, and Softmax represents the activation function; here, two layers of GNN are used to aggregate information, which is for good mining The subsequence in the spatio-temporal region has its own characteristics and the information of its surrounding locations; the attention score matrix can assign attention weights to each location, and extract the locations that the user pays more attention to in the local area.
S316:利用Atl和计算得到该用户在时空区域上的局部特征向量表示Locu;S316: using At l and Calculate and obtain the local feature vector representation Loc u of the user in the spatio-temporal region;
S317:遍历训练集中所有用户历史POI轨迹序列,计算得到每个用户在时空区域上的局部特征向量表示。S317: Traverse all user historical POI trajectory sequences in the training set, and calculate the local feature vector representation of each user in the spatio-temporal region.
S320:将该用户历史POI轨迹序列作为输入,使用全局特征模块计算该用户在以周为时间单位上的全局特征向量表示Glou,表达式如下:S320: Taking the user's historical POI trajectory sequence as input, and using the global feature module to calculate the user's global feature vector representation Glo u in the time unit of weeks, the expression is as follows:
Glou=LN(Ah+Dropout(PFFN(Ah))); (2)Glo u =LN(A h +Dropout(PFFN(A h ))); (2)
其中,Ah表示特征经过多头注意力后的输出,LN(·)表示神经网络中的层归一化,Dropout(·)表示防止模型过拟合而采用的方法,PFFN(·)表示正向前馈网络;Among them, A h represents the output of the feature after multi-head attention, LN( ) represents the layer normalization in the neural network, Dropout( ) represents the method used to prevent the model from overfitting, PFFN( ) represents the forward feed-forward network;
所述S320中计算用户在时空区域上的全局特征向量表示Glou的具体步骤如下:The specific steps of calculating the user's global feature vector representation Glo u in the spatio-temporal region in the S320 are as follows:
S321:随机选取一个用户历史POI轨迹序列,并将该用户历史POI轨迹序列中的时间信息进行融合,计算表达式如下:S321: Randomly select a user's historical POI trajectory sequence, and fuse the time information in the user's historical POI trajectory sequence, and the calculation expression is as follows:
其中,表示完成时间信息融合后的用户历史POI轨迹序列,W4表示可学习参数,表示轨迹序列与特殊时间周期的拼接向量;in, Indicates the user's historical POI trajectory sequence after time information fusion is completed, W 4 indicates the learnable parameters, A concatenated vector representing a sequence of trajectories and a special time period;
所述S321中进行时间信息融合的具体步骤如下:The specific steps for performing time information fusion in S321 are as follows:
S321-1:每个用户的历史轨迹序列为用户历史POI轨迹序列中的特殊时间模式,其中,表示轨迹序列中的地点表示向量,ti表示特殊时间周期的表示向量,u表示用户,week表示以周为单位的特殊时间周期;S321-1: The historical trajectory sequence of each user is Special temporal patterns in the sequence of user historical POI trajectories, in, Represents the location representation vector in the trajectory sequence, t i represents the representation vector of a special time period, u represents the user, and week represents the special time period in weeks;
S321-2:根据时间单位换算,将POI签入时间换算成以周为单位的特殊时间周期,得到特殊时间周期的嵌入矩阵 S321-2: According to the time unit conversion, convert the POI check-in time into a special time period in weeks, and obtain the embedded matrix of the special time period
根据word2vec词嵌入方法计算轨迹序列的嵌入矩阵E(Su),word2vec词嵌入方法为现有技术;Calculate the embedding matrix E (S u ) of the trajectory sequence according to the word2vec word embedding method, and the word2vec word embedding method is prior art;
S321-3:将和E(Su)在特征维度上进行拼接,得到拼接矩阵具体表达式如下:S321-3: will and E(S u ) are spliced on the feature dimension to get the splicing matrix The specific expression is as follows:
其中,con(·)表示拼接函数;Among them, con( ) represents the splicing function;
S321-4:利用激活函数对进行处理,得到完成时间信息融合后的用户历史POI轨迹序列 S321-4: Use the activation function pair Process to obtain the user's historical POI trajectory sequence after time information fusion
S322:计算的非侵入式的自注意力计算表达式如下:S322: Calculate non-intrusive self-attention The calculation expression is as follows:
其中,N表示有N层多头注意力网络层,Attention(·)表示注意力函数,Q、K、V分别是从和Su映射得到的可学习矩阵,KT表示K的转置矩阵,σ表示可学习的参数;Among them, N means that there are N layers of multi-head attention network layers, Attention(·) means the attention function, Q, K, and V are respectively from The learnable matrix obtained by mapping with S u , K T represents the transpose matrix of K, and σ represents the learnable parameters;
S323:计算N层多头注意力,计算表达式如下:S323: Calculate N-layer multi-head attention, the calculation expression is as follows:
其中,是第y层多头注意力网络层,Ah是多头注意力层的输出,GELU表示高斯误差线性单元,W5、W6、b5、和b6表示可学习参数;in, is the multi-head attention network layer of the y-th layer, A h is the output of the multi-head attention layer, GELU represents the Gaussian error linear unit, W 5 , W 6 , b 5 , and b 6 represent the learnable parameters;
S324:对各子层的输出进行层归一化处理和dropout函数处理,得到该用户在时空区域上的全局特征向量表示Glou;S324: Perform layer normalization processing and dropout function processing on the output of each sub-layer, and obtain the global feature vector representation Glo u of the user in the spatio-temporal region;
S325:遍历训练集中所有用户历史POI轨迹序列,计算得到每个用户在时空区域上的全局特征向量表示。S325: Traverse all user historical POI trajectory sequences in the training set, and calculate the global feature vector representation of each user in the spatio-temporal region.
S400:设置初始权重系数α,使用特征融合模块将Locu和Glou进行结合,也就是将用户的兴趣进行聚合,通过加权求和将局部特征与全局特征进行融合得到该用户的总偏好特征Cu,具体表达式如下:S400: Set the initial weight coefficient α, use the feature fusion module to combine Loc u and Glo u , that is, aggregate the user's interests, and fuse the local features with the global features through weighted summation to obtain the user's total preference feature C u , the specific expression is as follows:
Cu=αLocu+(1-α)Glou; (3)C u =αLoc u +(1-α)Glo u ; (3)
其中,α是表示权重系数,α∈[0,1];结合局部和全局特征可以更有效地在时空层面上捕获用户的行为偏好,而不是仅仅考虑轨迹序列;将这两种特征表示结合起来可以很好的完成位置预测工作,这里的结合是通过加权求和将局部特征与全局特征进行融合得到的,α的取值是从{0.0,0.1,0.2,...,0.8,0.9,1.0}中依次选取进行参数实验计算Cu值,当Cu值最大时对应的α值作为最优α值。Among them, α is the representation weight coefficient, α ∈ [0,1]; combining local and global features can more effectively capture the user's behavior preference at the spatio-temporal level, instead of only considering the trajectory sequence; combining these two feature representations It can complete the position prediction work very well. The combination here is obtained by fusing local features with global features through weighted summation. The value of α is from {0.0,0.1,0.2,...,0.8,0.9,1.0 } in order to conduct parameter experiments to calculate the Cu value, and the corresponding α value when the Cu value is the largest is taken as the optimal α value.
S500:利用总偏好特征Cu计算该用户的预测POI,具体步骤如下:S500: Using the total preference feature C u to calculate the predicted POI of the user, the specific steps are as follows:
S510:计算该用户的预测POI表示向量Pu,表达式如下:S510: Calculate the predicted POI representation vector P u of the user, the expression is as follows:
其中,表示轨迹序列中的地点表示特征,d表示特征维度,t表示时间,Co表示用户时空区域中地点间的特征关系,Co的计算表达式如下:in, Indicates that the location in the trajectory sequence represents the feature, d represents the feature dimension, t represents the time, Co represents the feature relationship between the locations in the user's space-time area, and the calculation expression of Co is as follows:
其中,表示时空区域的子序列表示向量,Wr是可学习的参数;in, The subsequence representation vector representing the space-time region, W r is a learnable parameter;
S520:通过索引映射将Pu映射到POI的地点标签,得到该用户的预测POI;所述索引映射为一个POI地点标签对应一个POI表示向量,两者为一一对应关系;S520: Map Pu to the location label of the POI through index mapping to obtain the predicted POI of the user; the index mapping is that a POI location label corresponds to a POI representation vector, and the two are in a one-to-one correspondence;
S600:利用该用户的预测POI表示向量来计算LGSA模型的目标函数K,具体表达式如下:S600: Using the user's predicted POI representation vector to calculate the objective function K of the LGSA model, the specific expression is as follows:
K=argmin∑(u,pos,neg)∈O-log(σ(Pu,pos-Pu,neg)); (6)K=argmin∑ (u,pos,neg)∈O -log(σ(P u,pos -P u,neg )); (6)
其中,Pu,pos表示真实POI与预测POI表示向量的距离,Pu,neg表示非当前用户轨迹序列中的POI与预测POI表示向量的距离,u表示用户标签,pos表示真实POI标签,neg表示非当前用户轨迹序列中的POI标签,σ表示sigmoid函数,目标函数要表达的是拉近预测的POI向量与真实值向量的距离,拉远与负采样向量的距离,所述负采样向量就是非当前用户的POI值,也就是当前用户没有签入过的POI;目标函数argmin使用的是贝叶斯个性化排序目标函数;Among them, P u,pos represents the distance between the real POI and the predicted POI representation vector, P u,neg represents the distance between the POI in the non-current user trajectory sequence and the predicted POI representation vector, u represents the user label, pos represents the real POI label, neg Represents the POI label in the non-current user trajectory sequence, σ represents the sigmoid function, and the objective function is to express the distance between the predicted POI vector and the real value vector, and the distance between the negative sampling vector and the negative sampling vector. The POI value of the non-current user, that is, the POI that the current user has not checked in; the objective function argmin uses the Bayesian personalized sorting objective function;
S700:利用目标函数K作为损失函数对LGSA模型进行训练,同时使用梯度下降法反向更新LGSA模型参数;S700: Using the objective function K as a loss function to train the LGSA model, and using the gradient descent method to reversely update the parameters of the LGSA model;
S800:遍历训练集中所有的用户历史POI轨迹序列,重复步骤S300-S700对模型进行训练,预设训练最大迭代次数,当训练达到最大迭代次数时停止训练,得到训练好的LGSA模型;S800: Traverse all the historical POI trajectory sequences of users in the training set, repeat steps S300-S700 to train the model, preset the maximum number of iterations for training, stop training when the training reaches the maximum number of iterations, and obtain a trained LGSA model;
S900:将待预测用户历史POI轨迹序列作为训练好的LGSA输入,输出为对该待预测用户下一个POI的预测结果。S900: Taking the historical POI trajectory sequence of the user to be predicted as the input of the trained LGSA, and outputting a prediction result of the next POI of the user to be predicted.
实验验证Experimental verification
1.数据集1. Dataset
本发明实验评估是在下面列出的两个公共LBSN数据集上进行的,它们属于已知公开的数据集,可信度比较高。数据集的具体情况如表1所示。The experimental evaluation of the present invention is carried out on the two public LBSN data sets listed below, which belong to known public data sets and have relatively high credibility. The details of the dataset are shown in Table 1.
Foursquare数据集:Foursquare是一个基于位置的社交网站,用户通过签到来分享他们的位置。该数据集包括2012年4月12日至2013年2月16日从Foursquare收集的纽约市和东京的长期(约10个月)签到数据,本发明中删除了访问少于10个POI的用户和访问人数少于10人的POI,经过预处理,纽约市的数据集包含1,078个用户的134,691次签到和4,513个POI,而东京的数据集包含2,266个用户的401,857次签到和6,952个POI。Foursquare Dataset: Foursquare is a location-based social networking site where users share their locations by checking in. The dataset includes long-term (approximately 10 months) check-in data of New York City and Tokyo collected from Foursquare from April 12, 2012 to February 16, 2013. Users who visited less than 10 POIs and POIs with fewer than 10 visitors, after preprocessing, the New York City dataset contains 134,691 check-ins and 4,513 POIs from 1,078 users, while the Tokyo dataset contains 401,857 check-ins and 6,952 POIs from 2,266 users.
Brightkite数据集:Brightkite曾经是一个基于位置的社交网络服务提供商,用户通过签到来分享他们的位置。而该数据集包含了2008年4月至2010年10月在Brightkite上产生的签到记录,本实验中选择前10000名用户,访问过少于10个POI或超过1000个POI的用户,以及访问人数少于10人的POI被删除,经过预处理,Brightkite数据集包含5153个用户的884,373次签到和19,034个POI。Brightkite dataset: Brightkite used to be a location-based social network service provider, where users shared their locations by checking in. The data set contains the check-in records generated on Brightkite from April 2008 to October 2010. In this experiment, select the top 10,000 users, users who have visited less than 10 POIs or more than 1,000 POIs, and the number of visitors POIs with less than 10 people are removed, and after preprocessing, the Brightkite dataset contains 884,373 check-ins and 19,034 POIs from 5153 users.
本实验将每个用户的前80%的序列作为训练集,后面的20%作为测试集,用户的历史轨迹按时间顺序进行排序。关于数据集的更详细的信息见表1。In this experiment, the first 80% of each user's sequence is used as the training set, and the latter 20% is used as the test set. The user's historical trajectories are sorted in chronological order. See Table 1 for more detailed information about the dataset.
表1数据集统计信息Table 1 Dataset Statistics
2.基线2. Baseline
本实验中主要专注于轨迹序列的特征和POI之间的时空影响来预测下一个POI,因此,将本发明提出的LGSA与下列基线模型进行比较。In this experiment, we mainly focus on the characteristics of the trajectory sequence and the spatiotemporal influence between POIs to predict the next POI. Therefore, the LGSA proposed by the present invention is compared with the following baseline model.
TOP:该方法记录了数据集中POI的受欢迎程度,并向用户推荐最受欢迎的POI。TOP: This method records the popularity of POIs in the dataset and recommends the most popular POIs to users.
ST-RNN:该方法在不同的时间间隔建立特定的时间转移矩阵,在不同的地理距离建立特定的距离转移矩阵,用于下一个地点的预测。ST-RNN: This method establishes a specific time transfer matrix at different time intervals, and a specific distance transfer matrix at different geographical distances for the prediction of the next location.
HGN:该方法将分层门控网络与贝叶斯个性化排名相结合,利用用户的长期和短期兴趣进行顺序推荐。HGN: This method combines hierarchical gating networks with Bayesian personalized ranking to leverage users' long-term and short-term interests for sequential recommendations.
MA-GNN:该方法使用记忆增强的图形神经网络来捕捉用户的长期和短期兴趣,进行顺序推荐。MA-GNN: This method uses a memory-augmented graph neural network to capture users' long-term and short-term interests for sequential recommendation.
STAN:该方法使用一个时空注意网络,从用户的轨迹中聚集所有相关的访问,并从加权表征中召回最合理的候选项用于地点推荐。STAN: This method uses a spatio-temporal attention network to aggregate all relevant visits from a user's trajectory and recall the most plausible candidates from weighted representations for place recommendation.
3.评价指标3. Evaluation indicators
根据之前的设置,本实验对下一个POI预测任务使用四个评价指标,这些评价指标是Precision@10、Recall@10、归一化折扣累积收益(NDCG@10)和平均精度(MAP@10),其中10是排名列表中POI的数量;当正确的POI在前10个POI中时,Precision@10和Recall@10的分数很高,NDCG@10作为排名结果的评价指标,用于评价排名的准确性,MAP对整个排名集的质量进行评分,这四个评价指标的值越大,表示性能就越好。According to the previous settings, this experiment uses four evaluation indicators for the next POI prediction task. These evaluation indicators are Precision@10, Recall@10, Normalized Discounted Cumulative Gain (NDCG@10) and Average Precision (MAP@10) , where 10 is the number of POIs in the ranking list; when the correct POI is in the top 10 POIs, the scores of Precision@10 and Recall@10 are high, and NDCG@10 is used as the evaluation index of the ranking result, which is used to evaluate the ranking Accuracy, MAP scores the quality of the entire ranking set, and the larger the value of these four evaluation indicators, the better the performance.
4.实验细节4. Experimental details
对于时空阈值,本实验在阈值为三位数中的四分之一位数、四分之三位数、中位数和平均值分别进行实验,取最优结果中位数作为阈值。地理距离和时间间隔同时超过中位数,划分一个区域。局部区域中的滑动窗口大小从{4,6,8,10}中选择分别进行实验,当L=6时在三个数据集上结果都最优。For the spatio-temporal threshold, the experiments were carried out at the threshold value of one-quarter digit, three-quarter digit, median and average value of the three-digit number, and the median of the optimal result was taken as the threshold value. Geographic distance and time interval exceed the median at the same time, and a region is divided. The size of the sliding window in the local area is selected from {4, 6, 8, 10} to conduct experiments respectively. When L=6, the results on the three data sets are the best.
在LGSA模型中,使用Adam优化器训练模型,学习率为0.001,并设置正则化参数为0.001;超参数在验证集上通过网格搜索进行调整;嵌入大小被设置为100。NYC和Brightkite的batch size被设置为2048,TKY的batch size被设置为4096。对于时空阈值,分别用时间间隔和空间间隔的平均值,25%、50%和75%作为实验的阈值,并取结果最好的50%作为阈值;当地理距离和时间间隔超过用户历史POI轨迹序列中相应的中位数时,时空区域被划分。本地特征中的滑动窗口大小w选自{4,6,8,10}进行实验。当w为6时,在三个数据集上的结果是最佳的,轨迹序列的长度被设定为100,局部权重系数α从{0.2,0.4,0.6,0.8,1.0}中选择进行实验,当α为0.4时,结果为最优。In the LGSA model, the Adam optimizer is used to train the model, the learning rate is 0.001, and the regularization parameter is set to 0.001; the hyperparameters are adjusted by grid search on the validation set; the embedding size is set to 100. The batch size of NYC and Brightkite is set to 2048, and the batch size of TKY is set to 4096. For the spatio-temporal threshold, use the average value of the time interval and space interval, 25%, 50% and 75% as the threshold of the experiment, and take the best 50% as the threshold; when the geographical distance and time interval exceed the user's historical POI trajectory Spatio-temporal regions are divided when the corresponding median in the series. The sliding window size w in local features is selected from {4, 6, 8, 10} for experiments. When w is 6, the results on the three data sets are the best, the length of the trajectory sequence is set to 100, and the local weight coefficient α is selected from {0.2, 0.4, 0.6, 0.8, 1.0} for experiments, When α is 0.4, the result is optimal.
5.结果5. Results
结果如图3,4,5所示,在baseline中,top在四个评价指标上效果是最低的,说明只是简单的获得POI的流行度并进行预测的是不行的;HGN和MA-GNN都是关注用户的长短期偏好,效果明显优于TOP,但缺少时空特征的考虑,所以效果低于LGSP;ST-RNN和STAN都是对轨迹是时空特征进行挖掘获得轨迹的上下文特征,但忽略了轨迹的序列特征和序列的周期性,所以结果低于LGSP。The results are shown in Figures 3, 4, and 5. In the baseline, top has the lowest effect on the four evaluation indicators, indicating that it is not enough to simply obtain the popularity of POI and make predictions; both HGN and MA-GNN It focuses on the long-term and short-term preferences of users, and the effect is obviously better than TOP, but it lacks the consideration of spatio-temporal features, so the effect is lower than LGSP; ST-RNN and STAN both mine the spatio-temporal features of the trajectory to obtain the context features of the trajectory, but ignore The sequence characteristics of the trajectory and the periodicity of the sequence, so the result is lower than LGSP.
LGSP模型在NDCG@10的指标上明显优于baseline,这说明模型对预测结果的排序效果好;其次,是在recall@10的指标上,这说明模型能够很好的召回要预测的item集合;但在precision@10的指标上,LGSP模型的优势不大,只比baseline提升一点。在TKY数据集上,LGSP在pre@10,NDCG@10,MAP评价指标上效果明显优于baseline,这说明LGSP模型在预测准确度、排序效果有提升,而对于召回提升不多;在Brightkite数据集上的效果没有太大提升,比baseline都只好一点。The LGSP model is significantly better than the baseline in the index of NDCG@10, which shows that the model has a good ranking effect on the prediction results; secondly, it is in the index of recall@10, which shows that the model can recall the item set to be predicted well; But in terms of the precision@10 indicator, the LGSP model has little advantage, only a little better than the baseline. On the TKY dataset, LGSP is significantly better than baseline in terms of pre@10, NDCG@10, and MAP evaluation indicators, which shows that the LGSP model has improved prediction accuracy and sorting effect, but has little improvement in recall; in Brightkite data The effect on the set is not much improved, and it is only a little better than the baseline.
6.参数实验6. Parameter experiment
为了研究不同设置对关键超参数的影响,本实验分别通过改变相关项目集批量大小和时空阈值的大小来评估LGSP模型:In order to study the impact of different settings on key hyperparameters, this experiment evaluates the LGSP model by changing the batch size of related itemsets and the size of the spatiotemporal threshold:
首先,改变批次大小。从256到4096翻倍,如图6所示。它表明在纽约市和Brightkite数据集上,当批量大小为2048时,获得了更高的性能,而在TKY数据集上,批量大小为4096。随着批量大小值的增加,模型的性能逐渐增加,这是因为当批量值过小时,训练数据难以收敛,导致拟合不足。First, change the batch size. Doubled from 256 to 4096, as shown in Figure 6. It shows that on the New York City and Brightkite datasets, higher performance is obtained when the batch size is 2048, while on the TKY dataset, the batch size is 4096. As the batch size value increases, the performance of the model gradually increases, because when the batch size value is too small, the training data is difficult to converge, resulting in underfitting.
其次,针对于时空阈值。本实验中对平均值、下四分位数、中值和上四分位数的阈值进行了实验,图7所示的结果表明,在三个数据集上,当时空阈值为中值时,获得了更高的性能;这表明基于中位值的时空阈值可以很好地划分用户的个性化时空区域;平均值忽略了时间间隔和地理距离的分布,异常值的存在容易使结果扩大或缩小;下四分位数和上四分位数都不能准确把握用户活动的时空区域。Second, aim at the spatio-temporal threshold. In this experiment, the thresholds of the mean, lower quartile, median and upper quartile were tested. The results shown in Figure 7 show that on the three data sets, when the spatiotemporal threshold is the median, A higher performance is obtained; this shows that the median-based spatio-temporal threshold can well divide the user's personalized spatio-temporal region; the average ignores the distribution of time intervals and geographical distances, and the existence of outliers tends to expand or shrink the results ; neither the lower quartile nor the upper quartile can accurately capture the spatio-temporal region of user activity.
7.消融实验7. Ablation Experiment
在NYC、TKY和Brightkite数据集上进行了LGSA模型的消融研究,包括四个方面:只考虑局部特征(LF),只考虑全局特征(GF),结合局部和全局特征(LF+GF),以及局部和全局特征的融合时间段(LF+GF+时间)。实验结果见表2。The ablation research of the LGSA model was carried out on the NYC, TKY and Brightkite datasets, including four aspects: only considering local features (LF), only considering global features (GF), combining local and global features (LF+GF), and Fusion time segment of local and global features (LF+GF+time). The experimental results are shown in Table 2.
表2在NYC、TKY和Brightkite数据集上的消融实验结果Table 2 Results of ablation experiments on NYC, TKY and Brightkite datasets
从实验结果看出,当只有全局特征时,在TKY数据集上的表现结果最差,这说明TKY数据集中用户的时空区域是一个非常重要的特征,在该平台的用户偏向于在时空区域内活动;从三个数据集中可以看出,预测下一个POI不仅要从全局考虑用户历史POI轨迹的序列性即随时间变化的动态偏好,还要从局部考虑用户个性化时空区域并挖掘POI之间的依赖性;从实验结果中可以看到时间周期特征对模型的性能提升不高,这是因为时间周期是放在全局的视角考虑,在模型结构中的比重不大。It can be seen from the experimental results that when there are only global features, the performance on the TKY dataset is the worst, which shows that the spatio-temporal region of users in the TKY dataset is a very important feature, and users on this platform tend to be in the spatio-temporal region Activities; from the three data sets, it can be seen that predicting the next POI should not only consider the sequentiality of the user's historical POI trajectory globally, that is, the dynamic preference that changes over time, but also consider the user's personalized spatio-temporal region locally and mine the gap between POIs. Dependence; From the experimental results, it can be seen that the performance of the time period feature does not improve the performance of the model very much, because the time period is considered from a global perspective, and the proportion in the model structure is not large.
最后说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或者等同替换,而不脱离本发明技术方案的宗旨和范围,其均应涵盖在本发明的权利要求范围当中。Finally, it is noted that the above embodiments are only used to illustrate the technical solutions of the present invention without limitation. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be carried out Modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present invention shall be covered by the claims of the present invention.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211176462.XA CN115510333A (en) | 2022-09-26 | 2022-09-26 | A POI Prediction Method Based on Spatio-Temporal Awareness Combining Local and Global Preferences |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211176462.XA CN115510333A (en) | 2022-09-26 | 2022-09-26 | A POI Prediction Method Based on Spatio-Temporal Awareness Combining Local and Global Preferences |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115510333A true CN115510333A (en) | 2022-12-23 |
Family
ID=84506566
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211176462.XA Pending CN115510333A (en) | 2022-09-26 | 2022-09-26 | A POI Prediction Method Based on Spatio-Temporal Awareness Combining Local and Global Preferences |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115510333A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116757369A (en) * | 2023-08-22 | 2023-09-15 | 国网山东省电力公司营销服务中心(计量中心) | Attention mechanism-based carbon emission analysis method and system |
-
2022
- 2022-09-26 CN CN202211176462.XA patent/CN115510333A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116757369A (en) * | 2023-08-22 | 2023-09-15 | 国网山东省电力公司营销服务中心(计量中心) | Attention mechanism-based carbon emission analysis method and system |
CN116757369B (en) * | 2023-08-22 | 2023-11-24 | 国网山东省电力公司营销服务中心(计量中心) | Attention mechanism-based carbon emission analysis method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110928993B (en) | User position prediction method and system based on deep cyclic neural network | |
Jiao et al. | A novel next new point-of-interest recommendation system based on simulated user travel decision-making process | |
CN113139140B (en) | Tourist attraction recommendation method based on space-time perception GRU and combined with user relationship preference | |
CN112579922B (en) | Interest point recommendation method based on user track | |
CN110119475B (en) | POI recommendation method and system | |
CN112149010A (en) | A method for group tourism route recommendation based on attention mechanism | |
CN111949877B (en) | Personalized interest point recommendation method and system | |
CN110334293A (en) | A time-aware location recommendation method based on fuzzy clustering for location-oriented social networks | |
CN107515949B (en) | User time-space similarity measurement method in interest point prediction and recommendation | |
CN110570044A (en) | Next Location Prediction Method Based on Recurrent Neural Network and Attention Mechanism | |
CN114637911B (en) | A next point of interest recommendation method based on attention fusion perception network | |
CN115545758A (en) | Method and System for Adaptive Incremental Site Selection of Urban Service Facilities | |
CN116542708A (en) | A scale recommendation and grading scoring method for intelligent high-quality commercial stores | |
CN115641718A (en) | A Short-Term Traffic Flow Prediction Method Based on Checkpoint Flow Similarity and Semantic Association | |
CN115510333A (en) | A POI Prediction Method Based on Spatio-Temporal Awareness Combining Local and Global Preferences | |
CN115952355A (en) | Next interest point recommendation system based on space-time power law attention | |
CN114048391B (en) | A method for recommending interest activities based on geographic grid | |
Yu et al. | Personalized recommendation of collective points-of-interest with preference and context awareness | |
Zeng et al. | LGSA: A next POI prediction method by using local and global interest with spatiotemporal awareness | |
CN117633371B (en) | Recommendation method, device and readable storage medium based on multi-attention mechanism | |
CN112749209A (en) | Method for constructing movement behavior map facing to space-time data | |
CN117874342A (en) | A method for recommending the next point of interest based on users' long-term and short-term preferences | |
CN115510317B (en) | A method and device for recommending points of interest in cloud-edge collaboration | |
He et al. | Personalized next point-of-interest recommendation via latent behavior patterns inference | |
CN113032688B (en) | A method for predicting the access location of social network users at a given time in the future |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |