Joint Geosequential Preference and Distance Metric Factorization for Point-of-Interest Recommendation

Point-of-interest (POI) recommendation is a valuable service to help users discover attractive locations in location-based social networks (LBSNs). It focuses on capturing users’ movement patterns and location preferences by using massive historical check-in data. In the past decade, matrix factorization has become a mature and widely used technology in POI recommendation. However, the inner product of latent vectors adopted in matrix factorization methods does not satisfy the triangle inequality property, which may limit the expressiveness and lead to suboptimal solutions. Besides, the extreme sparsity of check-in data makes it challenging to capture users’ movement preferences accurately. In this paper, we propose a joint geosequential preference and distance metric factorization framework, called GeoSeDMF, for POI recommendation. First, we introduce a distance metric factorization method that is capable of learning users’ personalized preferences from a position and distance perspective in the metric space. Specifically, we convert the user-POI interaction matrix into a distance matrix and factorize it into user and POI dense embeddings. Additionally, we measure users’ personalized preference for the POI by using the Euclidean distance metric instead of the inner product. Then, we model the users’ geospatial preference by applying a geographic weight coefficient and model the users’ sequential preference by using the Euclidean distance of continuous check-in locations. Moreover, a pointwise loss strategy and AdaGrad algorithm are adopted to optimize the positions and relationships of users and POIs in a metric space. Finally, experimental results on three large-scale real-world datasets demonstrate the effectiveness and superiority of the proposed method.


Introduction
e rapid development of mobile internet, positioning technology, wireless communication technology, and smart mobile devices, has much promoted the development of location-based social networks (LBSNs), such as Foursquare, Gowalla, and Facebook places [1].
ese LBSNs have attracted millions of users to share their locations and life experiences through check-in point-of-interest (POI), e.g., tourist attractions, restaurants, hotels, and shopping malls. A variety of available check-in data accumulated in LBSNs brings new opportunities for understanding and analyzing users' mobility. In order to meet the users' personalized needs for the location service, POI recommendation has been an important research topic in LBSNs [2]. As shown in Figure 1, the task of POI recommendation is to mine the users' movement preferences based on the massive users' historical check-in records and movement trajectories, to help the users to quickly discover exotic locations, and to overcome the "choice paralysis" problem [3]. POI recommendation not only provides users with a better location service experience but also helps location service providers tap potential customer requirements [4,5].
Different from traditional recommendation tasks, the interactions between a user and POIs reflect the user's real activities in the physical world. erefore, POI recommendation will be more challenging due to the limitation of user's activity range. ere are two specific aspects: (1) the number of POIs visited by users is generally small, so the extreme sparsity of an individual user's check-in data makes it difficult to obtain more accurate recommendation results; (2) the user's movement preference changes dynamically in different spatiotemporal contexts. erefore, there are two essential properties of users' check-ins that should be considered to improve the POI recommendation performance. On the one hand, geographic distance has an essential impact on users' check-in behavior. A large number of studies [6,7] have shown that the geographical influence is the most significant on POI recommendation as the user's activity range is a critical factor in determining whether the user travels far or not. e first law of geography [8] states that "everything is related to other things, but things that are closer are more closely related to," which can be understood as the spatial correlation of everything in the geographic space. e association of things that are closer in a geographic area is stronger. For example, users usually visit POIs around their workplaces at weekday, while they are more inclined to visit some POIs near their homes at the weekend. On the other hand, the users' check-in behavior presents specific sequential transition patterns. Existing research studies [9,10] have shown that sequential behavior is vital for POI recommendation because human movement exhibits complex sequence relationships. For example, some users prefer to go to a bar or nightclub for entertainment after dinner, rather than going to the gym to exercise, which reflects the users' sequential preference for check-ins. erefore, we aim at designing a fine-grained POI recommendation framework by capturing geographical influence and sequential influence.
Many advanced technologies, e.g., collaborative filtering (CF), Markov chain (MC), and metric learning (ML), have been proposed for POI recommendation. e matrix factorization-based CF approach becomes the first choice because it is widely used in traditional recommendation models [11]. To be specific, matrix factorization factorizes the large user-POI matrix into low-dimensional user/POI latent vectors and measures a user's personalized preference for a POI by utilizing an inner product of latent vectors. Specifically, many POI recommendation methods based on the variants of matrix factorization, such as Bayesian personalized ranking (BPR) [12], weighted matrix factorization (WMF) [13], and probabilistic matrix factorization (PMF) [14], have been proposed. However, matrix factorization suffers from an inherent defect as the inner product does not satisfy the crucial triangle inequality property, which may significantly reduce the accuracy of modelling similarity between users and POIs. is weakness limits the expressiveness and generalization of the matrix factorization model [10,15]. As another popular method, MC has been successfully applied to POI recommendation [16]. A major problem of MC-based methods is that these methods are based on a strong independence assumption among different factors. Recent studies have demonstrated that MLbased methods have significant advantages in modelling user's personalized preferences compared with traditional matrix factorization methods [9,10]. Unlike the matrix factorization methods, the ML model can directly adopt a distance metric which satisfies the axiom of triangle inequality to cluster similar users and POIs in a metric vector space. However, some works demonstrated that ML methods might suffer from the problem of overcongestion in the metric vector space, resulting in suboptimal solutions [15].
us, in this study, we propose a joint geosequential preference and distance metric factorization framework (GeoSeDMF), forming a new POI recommendation method. To be specific, to solve the POI recommendation task, we combine metric learning with factorization methods to capture users' fine-grained personalized preferences, geospatial preferences, and sequential preferences. First, we introduced a distance metric factorization method to model a user's personalized preference from a position and distance perspective in the metric vector space. en, considering the geographical influence and sequential influence of the user's check-in activity, the geographical influence is modelled by constructing the geographic weight coefficient, and the user's movement sequential transition is modelled by using the Euclidean distance of the continuous check-in locations. Finally, it linearly integrates the above essential factors and constructs a unified framework for POI recommendation.
e main contributions of this study can be summarized as follows: (i) We introduce a distance metric factorization model for the POI recommendation task, which can effectively acquire the user's personalized preferences from a position and distance perspective in the metric space. Specifically, we combine metric learning with factorization to avoid the limitations of traditional matrix factorization models. (ii) We design a unified recommendation framework by capturing the two types of intrinsic influences (i.e., geographical and sequential influences) in users' successive check-ins, which can model users' finegrained preferences for POIs and improve the performance of POI recommendation. e rest of this paper is organized as follows. Section 2 reviews the related work in POI recommendation. Section 3 introduces the preliminaries of this study. Section 4 presents the proposed model and optimization process in detail. Section 5 describes the experimental setups and presents the experimental results. Finally, we draw some conclusions of this study in Section 6.

Related Work
CF is one of the most widely used techniques in recommender systems [17,18]. Hence, many traditional CF methods have been introduced for the POI recommendation task. e first category is about user-based CF or POI-based CF. Some previous works predicted a user's preference based on the similarity of users or POIs by using a similarity measurement, such as cosine similarity or Pearson correlation [19,20]. For example, Horozov et al. [19] developed a user-based CF method to recommend restaurants to a user by finding which restaurants similar users have visited before. User-based CF or POI-based CF models have practical benefits, but they usually focus on a small subset of users or POIs.
e second category is about matrix factorizationbased CF, which can learn the latent factors that represent users' inherent preferences over POI's multiple dimensions [21][22][23][24][25]. MF has also become a popular model in POI recommendation because of its simplicity and scalability.
Due to the sparsity of user's check-ins, exploiting only check-in counts often suffers from poor performance. To achieve more accurate recommendations, current studies mainly utilize various information to supplement the highly sparse check-in data for POI recommendation tasks, such as geographical information, sequential characteristics, temporal information, social connections, and content information. For example, Ye et al. [20] developed a user-based CF algorithm based on naive Bayesian. ey proposed a unified recommendation framework, which incorporates both geographical influence and social influence within their model. Levandoski et al. [26] proposed a location-aware recommender system based on POI-based CF, which employs a user partitioning technique and a travel penalty technique to exploit item locations and provide a recommendation. Cheng et al. [22] first introduced the matrix factorization model to solve the POI recommendation task, and they studied users' multicenter movement patterns and acquired the spatial preference by employing a multicenter Gaussian model. Yuan et al. [27] and Gao et al. [28] proposed the time-aware POI recommendation framework by using different temporal aggregation strategies. Liu et al. [29] introduced a geographical probabilistic factor model for POI recommendation, which effectively employs regional popularity, geographical influence, and user mobility. Lian et al. [23] first proposed to exploit WMF for the POI recommendation task since it usually serves CF with implicit feedback better. ey designed a two-dimensional kernel density estimation model to capture the spatial clustering phenomenon. Recently, Lian et al. [24] further proposed a more efficient and flexible method, namely GeoMF++, which exploits both geographical influence and implicit feedback characteristics of check-in data. Wang et al. [30] used POI-specific geographical influence to improve POI recommendation, which models geographical influence by considering the geoinfluence of the POI, the geosusceptibility of the POI, and their physical distance. However, these methods have difficulty in solving the aforementioned inherent defects, and they fail to model complicated relations in the check-in sequence. Some existing works utilize the MC property to model check-in sequence relationships. Mathew et al. [31] introduced hidden Markov models (HMMs) to predict human mobility. Cheng et al. [16] proposed a personalized Markov chain model, namely, FPMC-LR, which takes into account users' sequential transition and movement constraints. Zhang et al. [32] exploited the sequential influence on location recommendations based on the nth-order additive Markov chain (AMC), which represents the sequential patterns from a dynamic location-location transition graph perspective. However, MC-based methods made a strong assumption of independence among different components.
Distance metric learning has become one of the most attractive research areas in machine learning, pattern recognition, and computer vision [33][34][35]. Ye et al. [36] proposed an adaptive metric learning (AML) model, which combines the ideas of clustering and distance metric learning. Chen et al. [37] proposed a nonlinear adaptive distance metric learning algorithm based on the AML algorithm combined with kernel learning technology. Wang et al. [38] learnt the distance metric by maximizing mutual information entropy. For the recommendation task, Hsieh et al. [39] argued that using inner product formulation lacks expressiveness in the matrix factorization model due to its violation of the triangle inequality, so they proposed the collaborative metric learning (CML) model which learns a joint metric space to encode not only users' preferences but also the user-user and item-item similarity. Zhang et al. [40] proposed the factorized metric learning (FML) model which represents users and items as points in a metric vector space and further designed two variants of metric factorization to tackle the two classic recommendation tasks: rating prediction and item ranking. Tran et al. [41] introduced a new capable and competent recommendation model, namely, HyperML, to explore metric learning in the hyperbolic space in a recommender system. Recently, ML methods have been proved to be useful in solving POI recommendation tasks. For example, Feng et al. [9] proposed a personalized ranking metric embedding method (PRME) to model personalized check-in sequences, and they demonstrated that distance metric learning models can capture common preferences from similar users more effectively than traditional MF models. Ding et al. [10] proposed a spatiotemporal distance metric embedding method (ST-DME) for POI recommendation, which exploits both geosequential and temporal properties of check-in to model users' time-specific preferences effectively.

Preliminaries to This Study
First, we introduce some relevant definitions used in this paper. en, we shortly recapitulate the basic idea of matrix factorization and the metric learning model.

Notations and Definitions
Definition 1. (POI). A POI is defined as a uniquely identified place (e.g., a hotel or a restaurant). In this paper, we use L � l 1 , l 2 , . . . , l N to denote a set of POIs, and each POI l i (1 ≤ i ≤ N) is associated with a unique geographical coordinate.

Definition 2. (check-in).
In LBSNs, users can share their physical locations and life experiences in the form of checkins, and a massive volume of check-in data has been collected at a lower cost. Each check-in record mainly contains a user-ID, POI-ID, timestamp, and comment content.
Definition 3. (preference matrix). In the POI recommendation task, the interaction between M users and N POIs can be expressed as a user-POI matrix R, and elements in the user-POI matrix are represented by 1 or 0 (each 0/1 indicates whether a user has visited the POI). e user-POI matrix implicitly reflects the users' preference for POIs, so it is also called a preference matrix. Definition 4. (distance matrix). In this paper, the distance matrix and the preference matrix can be regarded as a pair of opposite concepts. at is, the shorter the distance between the user and the POI in the metric space is, the higher the user's preference for POI is. To be specific, the user-POI distance matrix can be calculated by adopting a simple principle (i.e., distance (u, l) � 1 − preference (u, l)), which we will describe later.
Definition 5. (geosequential preference). Geosequential preference contains the user's geospatial preference and sequential preference. In this paper, we use geographic distance as a weighting factor to capture the geospatial preference and consider the sequential transition of continuous locations to capture the dynamic changes of the user's preferences.

Problem Definition (POI Recommendation).
e primary task of this study is to recommend to the POIs that the user is likely to visit in future travel plans by mining all users' historical check-in information. To be specific, given a set of M users and a set of N POIs, the user-POI preference matrix is represented as R M×N . We aim to generate a personalized POI recommendation list of k POIs to a user by using the distance metric factorization method and considering the user's geosequential preference. Table 1 presents some critical notations used in this paper.

Matrix Factorization Model.
Matrix factorization has become a widely used method to solve the POI recommendation task. e basic idea is to map users and POIs to a low-dimensional latent space and to model users' preferences by calculating the inner product of latent vectors of users and POIs. For example, a user-POI matrix containing M users and N POIs can be expressed as C (C ∈ R M×N ), where the elements C ui in matrix C represent the check-in frequency of user u to POI i: then, the optimization problem based on matrix factorization is defined as where ‖ · ‖ F is the Frobenius norm, P ∈ R M×d and Q ∈ R N×d (d ≪ min(M, N)) are the d-dimensional users' latent vectors and POIs' latent vectors, respectively, and c is a nonnegative regularization parameter to avoid overfitting. en, it becomes possible to approximate the missing value C uj � P u Q Τ j by using the alternating least squares (ALS) algorithm. e matrix factorization method, as mentioned above, directly draws on the idea of traditional explicit recommendation (e.g., movie or music recommendation) but simply replaces the score information with the check-in frequency. However, in the POI recommendation, users' historical check-in records belong to implicit feedback data. e check-in frequency only indicates the confidence level of the preference, and only positive samples can be observed. erefore, POI recommendation is considered as a one-class collaborative filtering (OCCF) problem [6]. Hu et al. [13] proved that the WMF model could obtain better results on implicit feedback data. To be specific, all unobserved interactions are considered as negative samples, and the same weight is set, usually set to 1. For positive samples observed, the check-in frequency is used as the confidence of users' preference, described as follows: where α(C ui ) is a monotonically increasing function with respect to C ui . Based on this weighted matrix, the objective function of the POI recommendation problem can be further calculated by the following operation: where ⊙ indicates the element-wise matrix multiplication and R is the binary 0/1 matrix, and each entry R ui ∈ 0, 1 { } indicates whether user u has visited POI i. Similarly, an ALS algorithm can be used to solve the objective function efficiently.
e basic idea of the POI recommendation method based on WMF is to use the inner product of the user/POI latent vectors. However, the inner product does not satisfy the triangle inequality property, which limits the expressive power of the matrix factorization model. In our method, we convert the user-POI matrix into a distance matrix and treat the POI recommendation problem from a position and distance perspective in the metric space, which effectively avoided the drawbacks of the existing matrix factorization methods.

Metric Learning Model.
In recent years, ML methods have been most widely used in fields such as computer vision, pattern recognition, and machine learning. ML refers to obtaining a metric matrix that can reflect the distance between samples by learning a given training dataset. e distance in the metric space demonstrates the similarity between samples, so it is also called similarity learning. For a the mapping function D in the metric space satisfies the following properties: In the metric space, Mahalanobis distance is a commonly used distance indicator in metric learning. For example, the distance between samples x and y is measured by the measurement matrix M d×d , described as follows: where M is a positive semidefinite matrix, which satisfies nonnegativity and symmetry. Given the equivalence constraints in S and the inequivalence constraints in D, the objective function can be expressed as erefore, the idea of the ML model is to minimize the sum of squared distances of similar pairs while constraining the sum of squared distances of nonsimilar pairs. In this way, similar pairs in the new metric space are aggregated, and nonsimilar pairs are pushed farther, thereby achieving the purpose of similarity learning.

Proposed GeoSeDMF Model
In this section, we introduce the GeoSeDMF model for the POI recommendation task. In detail, we first map users and POIs to a Euclidean metric space to obtain the user's personalized preference.
en, we design a unified recommendation framework by capturing the geographical influence and sequential influence. Finally, we give specific methods for model optimization and parameter learning.

Overview.
e framework of our GeoSeDMF model is presented in Figure 2, and the detailed steps are as follows: Step 1: establish the user-POI preference matrix R based on the users' historical check-in data, where the elements in the preference matrix are 1 or 0, indicating that the user has visited or has not visited the POI. In the traditional matrix factorization method, the preference matrix is generally directly adopted to calculate the user's location preference.
Step 2: convert the user-POI preference matrix R to the user-POI distance matrix D through a simple and efficient principle mentioned above. e purpose of this is that we can represent all users and POIs as points in the same metric vector space, so the distance between the user and the POI reflects the user's preference for a POI.
at is, we measure the user's personalized preferences from the distance perspective.
Step 3: construct a distance metric factorization model considering users' fine-grained personalized preferences, geospatial preferences, and sequential preferences. Specifically, we combine metric learning and factor decomposition models, which can more accurately model the user's personalized preferences as the Euclidean distance metric has better expressiveness than the inner product. Besides, we have considered the geosequential preference of the user's check-in behavior, which we will introduce in detail later.
Step 4: generate POI ranking and recommendation results. In this paper, we adopt a pointwise loss strategy and AdaGrad algorithm to optimize the positions and distance relationships between users and POIs in the metric space. en, the top-k POI recommendation

Modelling Users' Personalized Preference.
As mentioned above, matrix factorization-based POI recommendation methods assume that users and POIs can be represented by latent factors in a low-dimensional space. In this paper, we regard all users and POIs as points in the metric space. e distance between the points is used to model their interaction. e closer the distance is, the higher the user's preference for the POI is. To be specific, we introduce a simple principle (i.e., distance (u, l) � 1 − preference (u, l)) to convert the preference matrix R into a distance matrix D [15]. e distance matrix in our model represents the user-POI distance. We choose the distance matrix method for two reasons. First, the distance matrix is converted from the preference matrix, so the distance matrix can reflect the user's preference for the POI. Second, it is straightforward to be used as the goal of metric learning. It is worth noting that the POI recommendation task should consider unobserved negative samples, and the calculation of the distance matrix can be further improved via the following equation: where β is the distance scaling factor, which controls the shortest distance of negative samples, R u,l represents the elements in the user-POI preference matrix, and D u,l represents the elements in the user-POI distance matrix. Unlike the matrix factorization method which treats users and POIs as vectors in a latent "translation space," ML considers the users and POIs as points in the metric vector space, and their relationships are represented by distances (e.g., Euclidean distance or Mahalanobis distance). rough distance metric learning, all users and POIs in the metric vector space can be clustered to reveal the potential relationships between them. is involves mapping M users and N POIs into a d-dimensional (d ≪ min(M, N)) Euclidean space, and user u and POI l are represented as P u ∈ R k and Q l ∈ R k in the Euclidean space, respectively. erefore, the user's personalized preference for the POI can be measured by the Euclidean distance, and squared Euclidean distance is used to simplify the calculation, as shown in the following equation: where ‖ · ‖ 2 is used to calculate the Euclidean distance between the user's latent vector and POI's latent vectors. In equation (7), E(u, l) measures user u's personalized preference for POI l. Intuitively, if user u is interested in location l, the value of E(u, l) will be small, meaning that their position in the metric vector space will be close to each other. It is worth noting that our proposed model combines metric learning approaches and factorization-based models, which can effectively acquire the user's personalized preferences from a position and distance perspective in the metric space.
In addition, our model is essentially different from the method in [10,39] because [10,39] only use the metric learning model to solve the problem of triangle inequality; however, it possesses its own set of problems, i.e., overcongestion in the vector space.

Modelling Users' Geosequential Preference.
Unlike general recommendation (e.g., short videos, goods, movies, and news recommendation), POI recommendation is always closely related to users' continuous movement behavior, and the users' check-in behaviors are limited by the scope of  activities.
erefore, we further consider geosequential properties in the metric space to improve the performance of POI recommendation. First, we use the Euclidean distances of the users' continuous check-in locations to model sequential transition. User u's recent check-in POI l c and the next candidate check-in POI l are represented as Q l c and Q l in the same Euclidean space, respectively. A user's sequential preference for a POI is measured as follows: where ‖ · ‖ 2 is used to calculate the Euclidean distance between the recent check-in POI's latent vectors and the next candidate check-in POI's latent vectors.
To simultaneously consider the user's personalized preference and sequential preference, two types of Euclidean distances can be further linearly fused as follows: where α ∈ [0, 1] is the hyperparameter used to control the weights of the two kinds of distance. Particularly, if α is set to 1, the metric can only learn the personalized preferences of users, without considering the user-specific sequential preference, while if α is set to 0, the distance metric only captures the sequential preference, and the POI recommendation model is nonpersonalized. Previous works have shown that the geographical distance has an essential effect on the POI recommendation. For example, users prefer to check-in POIs closer to the current location in practice.
erefore, similar to [9], we further introduce a geographic weight coefficient to model the user's geographic preference as follows: where Δ(l c , l) is the geographical distance from l c to l and c is the hyperparameter used to control the contribution of the geographic distance. erefore, the integrated metric with the geosequential preference is calculated as follows: Obviously, in the metric vector space, the fused distance metric can cluster similar users and POIs as the ML method satisfies the triangle inequality property. Also, these clusters can be modelled more accurately and practically in the metric space by considering the geographic influence and sequential influence. For example, if both user u and user u' have visited POI l, the above method can not only pull user u and user u' closer to POI l but also pull u closer to u' in the metric vector space. In particular, the fused distance metric can not only effectively model users' fine-grained preferences but also contribute to the interpretability of the POI recommendation system. To be specific, all users and POIs are modelled in the same metric vector space, and similar users are pulled closer since they share similar personalized preference and geosequential preference; such an operation can also effectively alleviate the data sparsity problem.

Model Optimization and Parameter
Learning. In the specific POI recommendation task, the user-POI distance matrix D can be calculated according to formula (6), so our goal is to learn the predicted distance and position relationships between users and POIs based on the known distance matrix D. In order to learn a more accurately personalized POI ranking, we need to consider the unobserved items in the user-POI distance matrix. In many methods, unobserved items are regarded as negative samples, and joint pairwise ranking is used for training [6,9,10]. Our approach focuses on measuring the distance of the metric space, and the objective loss function based on a pointwise loss strategy is constructed as follows: where C u,l is the confidence value, which is used to consider all unobserved items and can be calculated as follows: where w u,l is the check-in frequency of user u to POI l. It can be seen that, by optimizing and training the objective loss function, the users and the positive POIs are pulled closer in the metric space, and the negative POIs are pushed farther. Also, our proposed model has high flexibility and fewer training parameters.
A proper regularization scheme is crucial for model training and can effectively solve model overfitting. Traditional matrix factorization methods generally use L 2norm regularization on users' and POIs' latent factors and biases. However, L 2 -norm creates a gradient to cluster users and POIs in the metric space close to the origin. is scheme is not suitable to be adopted here as the origin in the metric space does not have any specific meaning. erefore, we bound all the users/POIs within a Euclidean ball, i.e.,

Mathematical Problems in Engineering
where h is the Euclidean ball size; such a regularization scheme effectively avoids the curse of dimensionality. Similar to [15,40], AdaGrad is used to optimize the objective loss function of the proposed GeoSeDMF method. As for the general gradient descent method, each parameter training uses the same learning rate, but AdaGrad can automatically adjust the learning rate during training. e specific training process is as follows: where J(θ t,i ) represents the objective function that needs to be minimized, corresponding to formula (13). g t,i is the gradient value of the current parameter. G t,ii is the diagonal matrix, and each diagonal position (i, i) is the sum of squares of the corresponding parameters from the first round to the t-th round of the gradient. ε is a smooth term which is used to control the denominator to be nonzero. For the final POI recommendation task, we can directly sort according to the Euclidean distance trained in the metric space. e shorter distance between the user and the POI indicates that the user may have a greater interest in this POI.

Experiments
In this section, we use three large-scale real-world datasets to evaluate the performance of the proposed GeoSeDMF method. First, we introduce the three public datasets, seven state-of-the-art baselines, and four widely used evaluation metrics. en, we present our experiment settings and make a comparison between GeoSeDMF and the baselines. Finally, we study the impact of hyperparameters.

Datasets' Description.
ree public check-in datasets used in our experiments are Foursquare [27] (available at https:// www.ntu.edu.sg/home/gaocong/datacode.htm), Gowalla [27] (available at https://www.ntu.edu.sg/home/gaocong/datacode. htm), and Instagram [52] (available at https://dmis.korea.ac.kr/ cape), which are widely used benchmark datasets for evaluating POI recommendation algorithms. In the three datasets, each check-in comprises user-ID, POI-ID, timestamp, and geographical coordinates. e Foursquare dataset collects check-in data from August 2010 to July 2011 in Singapore. e Gowalla dataset collects check-in data from February 2009 to October 2010 in California and Nevada. e Instagram dataset collects check-in data from June 2011 to November 2016 in New York. To mitigate the impact of data sparsity, similar to [27,50], we empirically filter out those users who have fewer than five check-in POIs and those POIs which are visited by less than five users. Especially, the Instagram dataset contains a small amount of data that lack timestamps, and we further removed these noisy data. Besides, to reduce the amount of calculations, we only use data from October 2015 to September 2016 in our experiments. After data preprocessing, the basic statistics of the three datasets are shown in Table 2. Moreover, Figure 3 presents all users' spatial heat distribution of check-in in the three datasets. We can observe that users' activity ranges are relatively centralized, which is in line with the human mobility pattern because people tend to check-in around several centers and tend to check-in nearby locations.

Baseline Methods.
To illustrate the effectiveness of the GeoSeDMF model, we compare it with the following stateof-the-art POI recommendation methods: (i) BPR-MF [12], a Bayesian personalized ranking recommendation method based on matrix factorization: it optimizes the difference of user's preferences for positive and negative POIs by adopting a weighted pairwise optimization criterion (ii) GRU [53]: a robust variant of the RNN model, which leverages the temporal dependency in the users' behavior sequence through the gated recurrent unit network (iii) GeoMF [23]: a matrix factorization model that incorporates the geographical influence and explains the spatial clustering phenomenon (iv) FPMC-LR [16]: a first-order Markov model that models personalized sequential transitions and takes into account users' movement constraints (v) PRME-G [9]: a metric learning model that considers the geographic distance as a weight (vi) POI2Vec [43]: a latent representation model that incorporates the geographical influence and sequential influence (vii) ST-LSTM [48]: a new variant of LSTM, which implements time gates and distance gates into LSTM to capture the spatiotemporal relation between successive check-ins

Evaluation Metrics.
We choose three widely used evaluation metrics, namely, Recall@k [6,16], F1-score@k [47,50], and NDCG@k [49], where k is the length of the recommendation list. Formally, the three metrics are formulated and defined as where R u (k) denotes the set of POIs recommended to user u. T u denotes the set of POIs user u actually visited in the test set. rel n denotes the relevance of the nth POI to the user. Y u denotes the maximum DCG value of user u. Note that we report results of the three metrics with the setting of k � 5, 10, and 20 in our experiments. For all the metrics, the larger the value, the better the POI recommended performance.

Experiment Setup.
In our experiments, the latent factor dimension d, the Euclidean ball size h, the hyperparameter α, and the initial learning rate are set to 110, 1, 0.6, and 0.05, respectively. e hyperparameter β is set to 3 on the three datasets. Other baseline parameters are determined with grid search and random search to ensure all baselines achieve their best performance [54]. In order to facilitate the comparison of all algorithms, the training set and the test set of the experimental data are divided in the same way as that in [12,49], i.e., leave-one-out evaluation. To be specific, for each user's check-in sequence, the last POI is the test data, and the other data are for training. Specifically, all experiments are conducted with Python 3.5 and TensorFlow under a single GeForce RTX 2080Ti GPU environment.

Experimental
Results. Figures 4-6 depict the overall performance comparison of all methods evaluated by Recall, F1score, and NDCG on the three datasets. From the comparison results, we can draw the following conclusions: (1) it is obvious that our proposed GeoSeDMF outperformed all baselines for POI recommendation on the three datasets, which shows the effectiveness of the GeoSeDMF in solving the POI recommendation task. (2) We can observe both BPR-MF and GRU perform poorly because they do not take into account additional spatiotemporal contextual information. Although BPR utilizes the ranking-based optimization strategy and GRU considers the users' sequence relationships, they are still insufficient to improve the POI recommendation performance effectively. (3) Compared with BPR-MF and GRU, GeoMF incorporated geographical information into the WMF model. erefore, its performance is significantly better on the three datasets, indicating that modelling the geographical influence is essential for POI recommendation. (4) Unlike the GeoMF model which is based on the matrix factorization method, FPMC-LR and PRME are based on Markov chain and metric learning, respectively. It is worthy to note that FPMC-LR and PRME-G considered both geographical influence and sequential influence. However, it can be seen that FPMC-LR has not achieved higher accuracy than   GeoMF, perhaps because the FPMC-LR model is limited by the independence assumption of the Markov model. Fortunately, PRME-G has better performance than that of FPMC-LR. is meaningful result indicates that the use of ML and rankingbased optimization strategies can effectively improve the recommendation performance. Besides, we observe that POI2Vec slightly improves the performance compared with FPMC-LR and PRME-G because it incorporates the geographical influence of POIs in learning latent representations and develops a method to model the user preference and POI sequential transition jointly. ( Overall, our GeoSeDMF is optimal on three datasets, indicating the advantage of incorporating the geosequential influence via joint distance metric learning and factorization model. On the one hand, the GeoSeDMF model adopts the ML method to learn the positions and distances of users and POIs in the metric space. Unlike PRME-G, which also uses the ML method, the GeoSeDMF can directly sort the distance and generate recommendations by factorizing the metric space, so it effectively avoids the shortcomings of traditional matrix factorization methods. On the other hand, the GeoSeDMF model comprehensively considers the combined effects of users, POIs, sequence contexts, and spatial contexts and can simultaneously model general preferences, sequential transitions, and geographical influence of users' check-in behavior.

Study of the Influence of Parameters.
We study the influence of several hyperparameters in the GeoSeDMF, which are latent dimension size d, Euclidean ball size h, 20  component weight α, and distance scaling factor β. We adopt the metric Recall@k to report the performance results of the GeoSeDMF model with various values of hyperparameters. Figure 7 shows the recommended quality for different values of latent dimensions regarding Recall@5 and Recall@ 10 on the three datasets. In our experiment, we set d to 20, 40, 60, 80, 100, 120, 140, 160, 180, and 200, respectively. From Figure 7, it can be seen that the performance of the GeoSeDMF increases with d as higher dimensions can capture more complex interactions and learn more latent features. When the latent dimension value reaches 110, the model can obtain the best performance and then tends to stabilize. It is worth noting that, with the further increase of the latent dimension value, the model does not have obvious overfitting problems, which also proves that the stability and generalization ability of the proposed GeoSeDMF method are superior to those of the traditional matrix factorization method. Figure 8 presents the performance of the GeoSeDMF by varying the value of Euclidean ball size h from 0.5 to 1.5 regarding Recall@5 and Recall@10 on the three datasets. From the results, we observe that the performance first improves quickly with the increase of the value of Euclidean ball sizes, and then the increment becomes small. Geo-SeDMF achieves the best performance on the three datasets when h is set to 1, i.e., a unit Euclidean ball. erefore, for the POI recommendation task, setting h to 1 is sufficient as the implicit feedback is either 0 or 1. Figure 9 presents the performance of the GeoSeDMF by varying the value of component weight α from 0 to 1.0 and the distance scaling factor β from 1.5 to 5 while keeping the other optimal hyperparameters unchanged. As shown in Figure 9(a), GeoSeDMF achieves the best performance when component weight α is set to 0.6. As shown in Figure 9(b), GeoSeDMF achieves the best performance when distance scaling factor β is set to 3. However, β does not have as much influence as that of other parameters.

Conclusions
In this study, we propose a joint geosequential preference and distance metric factorization model (GeoSeDMF) for POI recommendation, which handles the recommendation task from a position and distance perspective in the metric space by simultaneously considering users' finegrained personalized preferences, geospatial preferences, and sequential preferences. More specifically, the proposed method measures a user's preference for a POI by adopting a Euclidean distance metric to replace the inner product. It can not only avoid the shortcomings (i.e., does not satisfy the triangle inequality property) of the existing matrix factorization methods but also help to handle the data sparsity. Besides, we have designed a geosequential preference fusion framework to combine the geographical and sequential influence for preference inference. e experimental results on three large-scale real-world datasets indicate that the GeoSeDMF significantly outperforms the state-of-the-art methods for POI recommendation in terms of three widely used metrics, i.e., Recall, F1-score, and NDCG. For future studies, we will focus on the extension of the GeoSeDMF by incorporating more check-in information, such as review texts, to improve its scalability and performance.

Data Availability
e data used to support the findings of this study are from previously reported studies and datasets, which have been cited.
e processed data are available from the corresponding author upon request.