1 Introduction

With the development of GPS-enabled smartphones and mobile internet, users can easily obtain real-time geographic location information, and record/share their activities and daily lives via check-in on Location Based Social Networks (LBSN), such as Yelp, Instagram, Foursquare and Twitter. Specifically, as the digital mirror to human trajectories in physical world, these POI check-in sequences on LBSN indicate human mobility and behavioral information, including sequential context or periodic transition patterns [16, 44]. For example, people may regularly stop by coffee shop to grab a cup of coffee on their way to work in the morning, and some users may prefer to have high-protein dinner after taking part in sports and physical activity, which can be explained as sequential transition patterns. The massive amount of check-in data can not only help understand users’ preferences for POIs and provide the possibility of personalized POI recommendation, but also benefit for business to acquire more potential customers. As a fact, the effective POI recommendation can significantly assist users to find their preferred POIs and help POI owners to attract more customers.

Recommender systems have been applied in a variety of areas, such as music recommendation [5, 35], content recommendation [21, 22], business process recommendation [11], and social recommendation [6]. POI recommendation has become a popular research direction and have attracted much attention [2, 4, 39]. As we know, LBSN is a complex heterogeneous network that includes the relationship between users and POIs. Compared to traditional recommender systems, POI recommendation faces three new challenges: 1) Correlations between consecutive POIs. Most existing POI recommendation methods consider all the users’ check-in data as a whole. Specifically, these works only utilize the check-in relationship between the users and the POIs, and ignore the correlations between consecutive POIs visited by a user. In fact, there are strong correlations between the POIs visited by the user and the POIs to be visited next. For example, as shown in Fig. 1, when User 1 left office at night after work, he/she would go to eat instead of going outdoors. 2) Implicit feedback properties for check-in data. In traditional recommender systems, users express their explicit feedbacks through ratings. However, the users’ check-in behaviors at POI are implicit feedbacks, where positive feedback is the POIs that user have visited. The POIs that are not visited include the POIs that users are not interested in and the POIs that users have not yet discovered but may be interested in. 3) The users’ personalized preferences and patterns. Two users with similar interests may have different behavior patterns. Therefore, a POI recommender system should recommend POIs for users based on their personalized preferences and patterns.

Fig. 1
figure 1

An example of users’ check-in sequences

In this paper, we propose a unified Context- and Preference- Aware Model (CPAM) for POI recommendation. Specifically, since users’ check-in behaviors at the target POI are influenced by users’ previously visited POIs and influence the POIs visited by the user after the target POI, we design a Skip-Gram based POI Embedding Model (SG-PEM) to capture the contextual influence of POIs, and learn the vector representation (embedding) of POIs from visiting sequences. Then we calculate the use rs’ preferences for the target POI based on the learned embeddings and similarity metric. For the implicit feedback information contained in the check-in data, we adopt the Logistic Matrix Factorization (LMF) algorithm [20] to model the users’ preferences for POIs from implicit feedbacks. Finally, we unify SG-PEM and LMF as the CPAM model to perform personalized recommendation by leveraging contextual influence and user preferences.

In summary, the main contributions of this paper are summarized as follows:

  • We design a Skip-Gram based POI Embedding Model called SG-PEM, which is able to learn the embedding of POIs and capture the contextual influence of POIs from users’ check-in sequences effectively.

  • We propose a unified model CPAM which combines the SG-PEM model and LMF model to capture both the contextual influence of POIs and users’ preferences, respectively, for better recommendation.

  • Experimental results on two real-world datasets show that the effectiveness of the proposed model CPAM compared with the state-of-the-art baselines.

The rest of the paper is structured as follows: After Section 2 introduces some related works, Section 3 details the proposed POI recommendation model. Then we compare its performance with some baselines in Section 4. Finally, Section 5 concludes the paper and outlines the future work.

2 Related works

The POI recommender system utilizes a user’s historical check-in data to model the behavioral patterns of the users and recommends a sequence of POIs based on the users’ preferences [27, 40]. Currently, researchers attempt to further improve the performance of the POI recommender system by integrating various information in the LBSN that affects the users’ check-in behavior. According to different types of fusion information, POI recommender systems can be divided into the following four categories.

POI recommendation incorporating temporal information

The users’ check-in behavior always shows the periodic characteristics change over time [16, 42]. For example, Li et al. [23] proposed a time-aware personalized POI recommendation by analyzing the trend of user behavior patterns over time and considering the long-term and short-term preferences for users.

POI recommendation incorporating geographical information

Since the check-in behavior is a physical interaction between users and POIs, users prefer to visit the POIs that close to them. Many researches have incorporated geographic information into POI recommendation [8, 26, 43]. For example, Rahmani et al. [30] proposed a POI recommendation model LGLMF by fusing the geographical model into the logistic matrix factorization approach. LGLMF improves the performance of recommendation by considering both users’ and locations’ point of view of geographical information.

POI recommendation incorporating category information

The POIs in LBSN are usually divided into different categories [16]. The category of the POIs visited by users implies the behavior characteristics of users. For example, shopping people like to go to various malls, and gourmets are keen to check in at restaurants. He et al. [17] proposed a two-step approach for next POI recommendation to predict users’ preferences for the category-level first, and then derive the ranking list of POI candidates based on the predicted category preference.

POI recommendation incorporating sequential information

Factorizing personalized Markov chains (FPMC) [31] is an extension of the ordinary Markov model and can provide personalized recommendations for different users. Recurrent Neural Network (RNN) has been proved very successful on modeling sequential information, and usually outperforms FPMC in POI recommendation [24]. In addition, many researchers have also tried to employ the Word Embedding technique to solve the POI recommendation problem [8] by transforming POIs into low-dimensional space vectors, and then recommend the next POIs for the user based on the similarity between the vectors.

When a user posts a check-in, he/she may also make a short comment, which describes the users’ feelings about POIs. Many researches [4, 38] have actively explored content information to improve the performance of POI recommendation. Generally, users’ comments at POI are short. It brings a great challenge to POI recommendation because the short texts are usually sparse, noisy, and ambiguous. In addition, social relationships are the attributes that LBSN inherits from traditional social networks. Many researchers have tried to use social relationships to improve the performance of POI recommender system [18, 41]. However, some studies show that only a small number of users have similar preferences with their friends in visiting POIs, and social relationships have limited influence on users’ check-in behavior.

3 Proposed model

In this section, we will introduce the proposed Context- and Preference- Aware Model (CPAM) in details. As shown in Fig. 2, we first capture contextual influence of POIs and learn vector representation (embedding) of POIs by a Skip-Gram based POI Embedding Model (SG-PEM). Then we calculate the users’ preferences for the target POI based on the learned embeddings and similarity metric. Moreover, we adopt the Logistic Matrix Factorization (LMF) algorithm [20] to model the users’ preferences for POI from implicit feedbacks. Finally, we unify these two models as CPAM model for POI recommendation.

Fig. 2
figure 2

Framework of the proposed CPAM model

3.1 POI embedding model

The proposed POI Embedding Model for learning the effective embedding of POI in this paper can be seen as part of the literature on representations learning [1]. Specifically, as one of the most popular embedding techniques, Word2Vec [28] can map symbolic data, such as words, from a space with one dimension per symbolic data object (one-hot representation) to a continuous vector space with much lower dimension based on sequences in training dataset, such as sentences, and the learned low dimensional representation of the object is called its embedding. Note that the learned embeddings can effectively capture items’ important relationships and features in training dataset. Recently, the embedding has been expanded to many sequential tasks, including trajectory data mining [3, 13], sequential recommender systems[35, 43], question answering [19], graph representation [14] and so on. As for POI recommendation, a check-in at a target POI would be influenced by users’ previously visited POIs, and influence the POIs visited by user after the target POI. To capture this contextual influence of POIs, we design a Skip-Gram based POI Embedding Model (SG-PEM). Before introducing the model, we define some basic concepts as follows.

Definition 1 (Check-in record and dataset)

Check-in record c = (u,p,t) consists of POI pP, user uU and check-in time t, and the whole dataset is defined as \(C=(c_{1}, c_{2}, c_{3},{\dots }, c_{\left |{C}\right |})\).

Definition 2 (Check-in sequence)

Check-in sequence is a list of POIs from a given user sorted by check-in time. The check-in sequence of the user u is defined as \(S_{u}=(p_{1}, p_{2}, p_{3}, {\dots }, p_{\left |{S_{u}}\right |})\), and all users’ check-in sequences is defined as \(S=(S_{u_{1}}, S_{u_{2}}, {\dots }, S_{u_{\left |{U}\right |}})\).

Definition 3 (Target and context POI)

As shown in Fig. 3, for a target poi pi in a user sequence Su, its context POIs {piw : pi+w}∖pi are the POIs visited before and after pi, where w is the context window size. Especially, each POI is firstly represented with a one-hot vector \(p_{i} \in \mathcal {R}^{\left |P\right |}\), where P is the POIs set.

Fig. 3
figure 3

POI embedding model

The SG-PEM model is described in Fig. 3. We consider a POI sequence as a “sentence”, and each POI in the sequence as a “word”. Skip-Gram model [29] can effectively capture the correlations between consecutive POIs and the contextual information before and after the target POI, and embed the one-hot vector of POI into low dimensional vector representation (embedding) by maximizing the objective function O, which is formulated as:

$$ O = \underset{S_{u}\in S}{\sum}\frac{1}{\left| S_{u} \right|} \underset{p_{i}\in S_{u}}{\sum}\underset{-w \leq k \leq w, k \not= 0}{\sum} \log (Pr(p_{i+k}{\mid}p_{i})). $$
(1)

Given the target POI pi, its context POIs are in a sliding window from piw to pi+w. Then we can predict its context by the embedding of POI pi according to probability Pr(pi+kpi), which is computed by using the soft-max function as follows,

$$ Pr(p_{i+k}{\mid}p_{i})= \frac{\exp{({\boldsymbol{p}^{\prime}}_{i+k} \cdot \boldsymbol{p}_{i})}}{\sum\nolimits_{l=1}^{{\mid}P{\mid}} \exp{(\boldsymbol{p}^{\prime}_{l}\cdot \boldsymbol{p}_{i})}}, $$
(2)

where \(\boldsymbol {p} \in \mathcal {R}^{d}\) and \(\boldsymbol {p}^{\prime } \in \mathcal {R}^{d}\) are input and output embedding of POI respectively, and ∣P∣ is the number of POIs. However, the computation complexity of the full soft-max function defined in (2) is proportion to the size of item set, which may reach millions in practice. Here, we apply the negative sampling technique [29] to calculate (2) over several negative samples instead of the whole dataset approximately and efficiently. Therefore, the training time yields linear scale to the number of negative samples and becomes independent of the item set size. Then the objective function O can be defined as:

$$ O = \underset{S_{u}\in S}{\sum} \frac{1}{\left| S_{u} \right|} \underset{p_{i}\in S_{u}}{\sum} \underset{-w \leq k \leq w, k \not= 0}{\sum} (\log \sigma (\boldsymbol{p}_{i+k}^{\prime} \cdot \boldsymbol{p}_{i}) + \frac{1}{n} \underset{\overline{p} \in P_{neg}}{\sum} \log \sigma (-\boldsymbol{\overline{p}}^{\prime} \cdot \boldsymbol{p}_{i})), $$
(3)

where Pneg is negative sample set with n negative samples, σ(⋅) is the sigmoid function, and \(\boldsymbol {\overline {p}}^{\prime } \in \mathcal {R}^{d}\) means the output embedding of sample \(\overline {p}\).

Then we define the preference of user ui for target POI pj with cosine similarity as follows:

$$ Preference\_pem_{u_{i},p_{j}}=cosine\_similarity(\boldsymbol{u}_{i}, {\boldsymbol{p}_{j}}), $$
(4)

where ui is user ui’s preference vector, and pj is the embedding of target POI pj, respectively. Since users’ preferences are reflected in their POI visiting sequences, we can infer and model the users’ preferences by aggregating the embeddings of POIs in their check-in sequences. Especially, ui is calculated with averaging aggregation, which keeps the wholeness and smoothness of the input embeddings with linear transformation. Formally, given the check-in sequence of the user u, ui is defined as

$$ {\boldsymbol{u}_{i}} = \frac{{\underset{{p_{k}} \in {S_{u}}}{\sum} {{\boldsymbol{p}_{k}}} }}{{\left| {{S_{u}}} \right|}}. $$
(5)

Besides, the definition of cosine similarity between two vectors v and \(\boldsymbol {v}^{\prime }\) is:

$$ cosine\_similarity\left( {\boldsymbol{v},\boldsymbol{v}^{\prime}} \right) = \frac{{\boldsymbol{v} \cdot \boldsymbol{v}^{\prime}}}{{\left\| \boldsymbol{v} \right\|\left\| \boldsymbol{v}^{\prime} \right\|}} = \frac{{\sum\limits_{i = 1}^{d} {{v_{i}}{v^{\prime}_{i}}} }}{{\sqrt {\sum\limits_{i = 1}^{d} {{v_{i}}^{2}} } \sqrt {\sum\limits_{i = 1}^{d} {{v^{\prime}_{i}}^{2}} } }} $$
(6)

3.2 Unifying the logistic matrix factorization model

There are two types of data used in traditional collaborative filtering recommendation models. One is explicit feedback data, which is usually the users’ ratings of items such as Netflix movie ratings. The other is implicit feedback data such as clicks, page views, or media streaming counts. In POI recommendation, check-in data on location-based social media can also be considered as implicit feedback data. In this section, we use the Logistic Matrix Factorization (LMF) model [20] to capture users’ preferences for POIs from implicit feedbacks. Since the LMF model cannot capture the contextual influence of POIs, we unify the SG-PEM model and LMF model at the end of this section.

Generally, matrix factorization (MF) based model learns user matrix Un×h and item matrix Pm×h by factorizing the observation matrix R, where h is the number of latent factors. The rows of U are h dimensional latent vectors that represent users’ preferences, and the rows of P are h dimensional latent vectors that represent an item’s characteristics. In this paper, we define fi,j as the number of check-ins that user i has visited poi j, Un×h(uiU) represents users’ latent factors, and Pm×h(pjP) represent POI’s latent factors. Given the observation matrix R, we can define our “confidence” in the entries of R as ri,j = αfi,j, where α is a tuning parameter. Formally, ui’s preference for POI pj is defined as,

$$ Pr(f_{i,j}\mid \boldsymbol{u}_{i},\boldsymbol{p}_{j},\boldsymbol{\beta}_{i},\boldsymbol{\beta}_{j} )= \frac{\exp{(\boldsymbol{u}_{i}\boldsymbol{p}_{j}^{\mathrm{T}} + \boldsymbol{\beta}_{i} + \boldsymbol{\beta}_{j})}}{1 + \exp{(\boldsymbol{u}_{i}\boldsymbol{p}_{j}^{\mathrm{T}} + \boldsymbol{\beta}_{i} + \boldsymbol{\beta}_{j})}} $$
(7)

where the βi and βj terms are user bias and POI bias. Then we learn U, P and β by maxing the objective function as follows:

$$ \arg \max \boldsymbol{U},\boldsymbol{P},\boldsymbol{\beta} \log Pr(\boldsymbol{U},\boldsymbol{P},\boldsymbol{\beta} \mid \boldsymbol{R}) $$
(8)

where \(\log (Pr(\boldsymbol {U},\boldsymbol {P},\boldsymbol {\beta } \mid \boldsymbol {R})\) is formulated as:

$$ \underset{i,j}{\sum} r_{i,j} (\boldsymbol{u}_{i}\boldsymbol{p}_{j}^{\mathrm{T}} + \boldsymbol{\beta}_{i} + \boldsymbol{\beta}_{j})-(1+r_{i,j}) \log (1+\exp{(\boldsymbol{u}_{i}\boldsymbol{p}_{j}^{\mathrm{T}} + \boldsymbol{\beta_{i}} + \boldsymbol{\beta}_{j})}) - \frac{\lambda}{2} \left\|\boldsymbol{u}_{i}\right\|^{2} - \frac{\lambda}{2} \left\|\boldsymbol{p}_{j}\right\|^{2} $$
(9)

Finally, we construct a novel POI recommendation model CPAM, which unifies SG-PEM and LMF with weighted sum strategy to predict users’ preferences for POIs and perform recommendation. Specifically, weighted sum is a concise and effective strategy of linearly combining multiple components/objectives and it is widely used in or machine learning tasks [33, 34], including recommendation and prediction . Formally, the final preference probability function of user ui at POI pj is represented as follows:

$$ Preference_{u_{i},p_{j}}=Preference\_pem_{u_{i},p_{j}}+\gamma Pr(f_{i,j}\mid \boldsymbol{u}_{i},\boldsymbol{p}_{j},\boldsymbol{\beta}_{i},\boldsymbol{\beta}_{j} ) $$
(10)

where \(Preference\_pem_{u_{i},p_{j}}\) is calculated by (4), and γ is the weight of LMF.

4 Experiments

We compare the proposed POI recommendation model CPAM with state-of-the-art baselines on two public real-world check-in datasets.

4.1 Datasets

We choose two typical LBSN (Foursquare and Gowalla) real-world check-in datasetsFootnote 1 [25]. The time span of Foursquare dataset is from April 2012 to September 2013, and we remove the users who have less than 10 check-in POIs and the POIs with less than 10 checked-ins. The time span of Gowalla dataset is from February 2009 to October 2010, and remove the users who have less than 10 check-in POIs and the POIs with less than 10 checked-ins. The statistics of the two datasets are listed in Table 1. Sparsity means how sparse the user-POI interaction data is. Specifically, if there exists k interaction records between m users and n POIs, then the corresponding data sparsity is \(1-\frac {k}{m \times n}\). For example, the sparsity of Foursquare dataset is \(1-\frac {512,523}{7,642 \times 28,483} = 99.76\%\). Besides, we choose the first 70% of each users’ check-ins as training data, the last 20% as test data, and the remaining 10% as validation data.

Table 1 Statistics of datasets

4.2 Evaluation metrics

In this work, we adopt three widely used metrics to compare evaluate the performance, which are Precision@N, Recall@N and F1@N score, where N is the length of recommendation list. Formally, Precision@N, Recall@N and F1@N are defined as follows:

$$ Precision@N=\frac{\left| I^{rec} \bigcap I^{test} \right|}{m} $$
(11)
$$ Recall@N=\frac{\left| I^{rec} \bigcap I^{test} \right|}{\left| I^{test}\right|} $$
(12)
$$ F1@N=\frac{2*Precision@N*Recall@N}{Precision@N+Recall@N} $$
(13)

where Irec is the top-N recommended POI list of target users, and Itest is the visited POI list of target users in test set. For these three indicators, we set N = 10,20 to evaluate the performance of the proposed approach and baselines.

4.3 Comparison methods

We compared the proposed model CPAM with the following POI recommendation methods:

  • LRT [12]: A POI recommendation model with temporal influence based on observed temporal properties.

  • LMF [20]: A probabilistic model for matrix factorization with implicit feedback. It can model the probability that a user will prefer a specific POI.

  • L-WMF [15]: A location-based matrix factorization approach for POI recommendation, which captures the geographical influence from a location perspective.

  • LMFT [32]: A novel method to incorporate spatial, temporal, and social influence into a collaborative filtering algorithm.

  • LGLMF [30]: An approach is proposed by fusing the local geographical model into the logistic matrix factorization algorithm.

  • iGLSRFootnote 2 [41]: A POI recommendation method fusing user preferences, social influence, the geographical influence of users, and the personalized geographical influence of locations.

  • PFMMGM [7]: A geo-social recommendation method which fuses matrix factorization with social and geographical influence, it uses the Multi-center Gaussian Model (MGM) model users’ preferences for a POI to capture the geographical influence.

  • SG-PEM: Our designed Skip-Gram based model for POI embedding and recommendation.

  • CPAM: Our proposed model for POI recommendation by leveraging contextual influence and user preferences.

4.4 Parameter settings

For the comparison models, the parameters are initialized according to the settings in the corresponding paper. For LMF, PFMMGM and L-WMF, the latent factors parameter k are set to 30. We set the distance threshold to 15 and the frequency control parameter α to 0.2 for PFGMGM. For LRT, temporal state T is set to 24, and the regularization parameters α and β are set to 2.0. The parameters of the proposed model CPAM are adjusted according to the validation dataset. After optimizing the parameters, we set latent factors parameter k = 10, embedding dimension m = 150, context window size w = 3, and weight parameter γ = 0.1.

4.5 Experiment results

In this subsection, we firstly demonstrate and analyze the results of the proposed model CPAM compared with other baselines. Then we explore the effect of data sparsity, effect of embedding dimension and effect of γ on recommendation performance, respectively. The source code and results of experiments can be downloaded from http://dbsi.hdu.edu.cn/CPAM/ for reference.

4.5.1 Performance comparison

We firstly compare the proposed model CPAM with the baseline models on both Foursquare and Gowalla datasets. As shown in Figs. 45 and 6, LRT gets much lower performance than other baselines for all metrics, indicating that this model is insufficient for POI recommendation. Compared with the PFMMGM and LRT, iGLSR models geographical influence based on users’ behavior, and thus obtains a better performance. Among these baselines, LMF and LGLMF perform better than PFMMGM and iGLSR. Specifically, Fig. 4a and b show that LMF outperforms PFMMGM by 26.00% and 31.40% with Precision@20 on Foursquare and Gowalla, respectively. One reason is that the LMF model makes better use of implicit feedback of check-in data and captures users’ preferences more effectively. Besides, LGLMF model is better than LMF, L-WMF and LMFT. For example, as shown in Fig. 5a and b, LGLMF outperforms LMF by 20.00% and 17.79% with Recall@20 on Foursquare and Gowalla, respectively. This is because the LMF only considers the users’ preferences for POIs, while LGLMF considers both the users’ and the locations’ points of view in modeling the geographical influence.

Fig. 4
figure 4

Precision@N on Foursquare and Gowalla

Fig. 5
figure 5

Recall@N on Foursquare and Gowalla

Fig. 6
figure 6

F1@N on Foursquare and Gowalla

The proposed model SG-PEM performs much better than LGLMF model. Specifically, Fig. 5a and b show that SG-PEM outperforms LGLMF by 27.78% and 24.92% with Recall@10 on Foursquare and Gowalla, respectively. The results demonstrate that the effectiveness of our Skip-Gram based POI Embedding Model SG-PEM and indicates that contextual influence of POIs should be taken into consideration to improve performance during POI embedding learning. As shown in Fig. 6a and b, our proposed model CPAM outperforms SG-PEM (LGLMF) by 26.27% (37.96%) on Foursquare and by 20.52% (29.38%) on Gowalla with F1@20. Moreover, CPAM achieves the best performance on both datasets for all metrics, which shows that the effectiveness of our proposed CPAM model for leveraging contextual influence and users’ preferences for POI Recommendation.

4.5.2 Effect of data sparsity

In this work, the data sparsity means how sparse the user-POI interaction data is. Specifically, the sparsity of Foursquare and Gowalla datasets are 99.76% and 99.65% respectively, which influence the performance of the proposed model and baselines. Therefore, we perform experiments on datasets with different percentages of POIs that each user has visited in the training data to further evaluate the performance of the proposed model and baselines. The percentages are set to (40%, 60%, 80%, 100%) respectively, and their corresponding sparsities are (99.89%, 99.86%, 99.82%, 99.76%) for Foursquare and (99.84%, 99.78%, 99.73%, 99.65%) for Gowalla. Figure 7 demonstrates the comparison of Recall@20 with different sparsities of Foursquare and Gowalla datasets. The LGLMF model has similar performance with CAPM when sparsity is 99.89% on Foursquare and 99.84% on Gowalla respectively, even LGLMF is slightly better than CPAM on Foursquare dataset when sparsity is 99.89%. This is because the higher sparsity of dataset leads to shorter average length of users’ POI sequences, and CPAM cannot capture sufficient contextual information. Moreover, the proposed approach CPAM achieves better performance than LGLMF in most cases, and CPAM outperforms other baselines on Foursquare and Gowalla, which shows the effectiveness of CPAM in POI recommendation, especially on sparse datasets.

Fig. 7
figure 7

Comparison on Foursquare and Gowalla with different sparsity

4.5.3 Effect of embedding dimension d and context window size w

Figure 8a shows the comparison of Recall@20 with different embedding dimension d from 10 to 210. We can see that for both datasets, the Recall@20 increases with the increasing of the dimension of embedding from 10 to 170. This is because the larger embedding dimension could capture more comprehensive contextual information. When the embedding dimension reaches about 170 for both datasets, CPAM model achieves the best performance. Then we can see that the performance of CPAM becomes stable when dimension is greater than 170, which shows that dimensions from 170 to 210 are sufficient for capturing contextual influence of POIs. Figure 8b shows the variations in performance when we change the context window size w from 1 to 5. Specifically, we can see that for both datasets, the Recall@20 increases with the increasing of w from 1 to 3. CPAM obtains the best performance when w is 3, and shows a steady performance when w is greater than 3, which demonstrates that the model can effectively capture contextual influence between POIs when w is greater than 3.

Fig. 8
figure 8

Effect of embedding dimension and context window size

4.5.4 Effect of hyper-parameter γ

CPAM model optimizes the linearly combination of Skip-Gram based POI Embedding Model (SG-PEM, (4)) and Logistic Matrix Factorization (LMF, (10)) using a hyper-parameter γ. Specifically, γ is the weight of Logistic Matrix Factorization (LMF), and small γ means weakening LMF and enhancing the impact of the influence of SG-PEM, and vice versa. Figure 9 demonstrates the comparison results in terms of Precision and Recall with different γ from 0 to 10.0. Firstly, CPAM model obtains better performance when γ > 0 than γ = 0, which shows that both SG-PEM and LMF in CPAM are necessary for accurate POI recommendation. Secondly, CPAM model obtain the best overall performance of Precision and Recall on both Foursquare and Gowalla datasets when γ = 0.1. Moreover, with γ increasing, especially when γ > 1.0, the performance of CPAM shows a downward trend on all metrics, which demonstrates that the sequential check-in patterns and contexts captured by SG-PEM are more important in improving POI recommendation.

Fig. 9
figure 9

Effect of hyper-parameter γ

5 Conclusion

In this paper, we propose a CPAM model for POI recommendation. We first design a Skip-Gram based POI Embedding Model (SG-PEM) to capture the contextual influence of POIs and learn the embedding of POIs from visiting POI sequences. Then we calculate the users’ preferences for the target POI based on the learned POI embeddings and similarity metric. For the implicit feedback information contained in the check-in data, we adopt the Logistic Matrix Factorization (LMF) algorithm to model the users’ preferences for POIs from implicit feedbacks. Finally, we unify these two models as the CPAM model to perform personalized POI recommendation by leveraging contextual influence and user preferences. Experimental results on two real-world datasets, i.e., Foursquare and Gowalla, demonstrate that the effectiveness of our proposed model CPAM compared with the state-of-the-art baselines. In the future, we plan to exploit category information, social information, temporal information, metadata [36] with advanced integrating strategies, such as attention mechanism [37] and ensemble learning [10], to enhance POI recommendation model. Besides, we will also try to model users’ preferences with powerful methods, such as recurrent neural network [9], to further improve the performance.