Location Contexts of User Check-Ins to Model Urban Geo Life-Style Patterns

Geo-location data from social media offers us information, in new ways, to understand people's attitudes and interests through their activity choices. In this paper, we explore the idea of inferring individual life-style patterns from activity-location choices revealed in social media. We present a model to understand life-style patterns using the contextual information (e. g. location categories) of user check-ins. Probabilistic topic models are developed to infer individual geo life-style patterns from two perspectives: i) to characterize the patterns of user interests to different types of places and ii) to characterize the patterns of user visits to different neighborhoods. The method is applied to a dataset of Foursquare check-ins of the users from New York City. The co-existence of several location contexts and the corresponding probabilities in a given pattern provide useful information about user interests and choices. It is found that geo life-style patterns have similar items—either nearby neighborhoods or similar location categories. The semantic and geographic proximity of the items in a pattern reflects the hidden regularity in user preferences and location choice behavior.


Introduction
The recent introduction of the location-based services in smartphone-based social media applications allows people to share their activity related choices in their virtual social networks (e.g., Facebook Places, Foursquare). Such sharing occurs at the level of specific geo-location and time of where and when an individual participates in an activity. This vast amount of geo-location data offers us, in new ways, people's attitudes and interests through their activity-location choices over a large number of users and over multiple months/years that was unimaginable before. In addition to location and timing, this data reveals our interests towards specific brands or types of locations for different activity purposes (e.g., Walmart, Target, Whole foods for grocery shopping). From this new information, we can understand human mobility behavior in a better way. We can infer users' life-style choices from their activity-location choice patterns. However, while this new data is available, there are currently limited methodologies to infer life-style choices to characterize individual activity patterns important for understanding behavior. In this paper, using activity participation data shared in social media, we develop probabilistic models inferring individual interests to activity-locations and thereby obtain the life-style patterns of people living in an urban area.
The linkage between life-style and activity participation has been well recognized in activity-based travel behavior analysis [1][2][3][4] in the domain of transportation science. Individuals' daily activity and travel patterns with longer-term choices of residential location, work place location and vehicle ownership are inter-related with each other and jointly define their lifestyle patterns [5]. Hence the concept of life-style choice provides a useful framework to study urban human activity and travel behaviors.
However, in the literature, there is no general consensus on a definition of life-style based on individual activity patterns. Life-style definitions vary from conceptual to operational ones. Most definitions belong to one of the two broader perspectives: a) life-style as behavioral patterns such as activity and time use patterns and b) life-style as a behavioral orientation [4]. The former approach views life-style as changing as an individual adapts to the surrounding environment while the later approach views life-style as an orientation which the individual wants to maintain by changing his or her actions. Changes in individual values, attitudes, and preferences may affect, in the long term, the individual's life-style as orientation. Empirical studies have found evidence of the linkages between individual life-style choices and activity-travel behaviors. These behaviors include short-term choices, such as activity types and frequencies, travel distances, mode of travel [5][6][7], and more long-term choices, such as where to live and work [5] and what type of car to buy [8].
As location-based datasets from social media are becoming increasingly available, there is potential to characterize and infer user preferences from these datasets. Researchers have already been using these datasets to gather interesting insights on different aspects related to human mobility and activity choices. Studies from social science, computer science, and transportation science have used innovative ways to extract meaningful patterns with diverse applications. These studies include activity recognition [9], discovering mobility and activity choice behavior [10][11][12][13][14][15][16], classifying activity choice patterns [17], estimating urban travel demand and traffic flow [18][19][20], predicting next place to check-in [21], modeling the influence of friendship on mobility patterns [22], and detecting neighborhood boundaries [23].
With large sample size covering a long period (e.g., for a year) and providing locations and timings of individual activity participation, location-based datasets have further potential for activity-based modeling. However, a major challenge of using these datasets for activity behavior modeling is that individuals are recognized by only the identification numbers without any detailed information on socio-economic characteristics (e.g., income, age, race etc.). These attributes of the social media users are difficult to obtain. Without the socio-demographic attributes of the users, it is difficult to explain or to gain deeper insights from the observed patterns. We need to cluster the population based on a set of generic characteristics and correlate patterns with those characteristics providing a behavioral underpinning to different patterns observed from social media data. In this paper, we introduce the life-style concept giving a richer medium to understand the higher dimensions of activity patterns observed in social media.
We develop a clustering approach based on probabilistic topic models [24] to understand individual geo life-style patterns through their activity-location choices revealed in social media. We infer the life-style choice patterns using the location contexts of user check-ins. As location contexts, we use a combination of the names of the activity-locations, categories of the locations and the surrounding neighborhoods of the locations. We test our modeling approach to classify individual life-style patterns using a dataset of Foursquare check-ins (posted via Twitter) of 3256 users from New York City.
Our goal is to extract individual life-style patterns by modeling their interests towards specific types of restaurants, grocery or supermarkets, clothing stores etc., types of locations and neighborhoods. These life-style patterns will work as a bridge to understand the relationship between individual characteristics and their activity patterns. For instance, an individual's interests towards more expensive types of restaurants may indicate his or her income level. On the other hand, a user's visiting patterns to certain neighborhoods may reflect his or her local geographic context. Such geographic contexts can provide information on the socio-demographic characteristics such as income level, ethnicity etc. of the user.
Thus this analysis overcomes a major challenge of using social media data for behavior modeling in general. It helps to reconstruct individuals' profiles although traditional socio-economic characteristics (e.g., income, race etc.) of those individuals are not observed. Thus the proposed method helps to classify individuals based on their geo life-style patterns. Such classification or segmentation of individuals will add some behavioral underpinnings to the observed patterns from social media data.
Previous studies [25,26] used topic models to learn patterns from location-based social media data. For instance, Ferrari et al. [25] found city-level patterns that can identify hotspots in the city, and recognized aggregate-level behaviors recurring over time and space in the urban scenario. Similarly, Joseph et al. [26] used topic models for inferring aggregate patterns to identify groups of people with different types, communities and interests. However, we introduce the concept of life-style, for the first time, into the growing literature of activity-travel behavior analysis based on social media data and show its importance for behavioral modeling in general. Further, instead of inferring aggregate patterns based on topic models, we model user-specific patterns extending the topic modeling approach [24]. Such user-specific patterns recognize the user-level heterogeneity within the modeling framework. Our contributions are summarized as follows: • We demonstrate that activity-location choice data from social media can be used to infer user life-style choices. We consider the categories of activity-locations and the neighborhoods representing the urban space semantics to infer user interests and spatial contexts.
• We show that topic models can be applied well to infer user life-style choices. We extend the topic modeling approach to infer user-specific patterns.
• We find that user interests to various activity-location choices have semantic and geographic proximity and we discuss the plausible reasons behind these proximities.

Materials and Methods Dataset
We use check-in information posted via Twitter which allows its users to post their statuses from third-party check-in services (e.g. Foursquare). When foursquare users check-in to a place this status can be posted to their Twitter pages. We use a large-scale check-in dataset available from Cheng et al. [11]. The dataset contains check-ins from Feb, 25, 2010 to January, 20, 2011. After collecting the tweets, we pre-process the data where each data point is stored as a tuple with the following information: tweet(tweetID) = {userID, screen name, tweetID, date, location, text} An example of a tweet with a check-in looks like (we replace the tweetID, userID, screen name and check-in ID with # so that the user cannot be To find individual life-style patterns, we study only the geo-active users having more than 50 check-ins. Basic information about the dataset is given in Table 1.

Modeling Framework
User check-ins can be enriched with additional location contexts. Such contexts include the name of the place where the user has checked-in, the category of the place and the neighborhood of the area. Each of the collected tweets with a check-in from Foursquare has a short link. We run a query using the Foursquare API with the short link as an input and collect the detailed check-in information including the name and category of location where the user has checked-in. Thus we enrich the location contexts of each check-in with names and/or category  of the location and the neighborhood of the place to model individual life-style patterns. This location category information can also be used to label the category of the activity for each check-in and consequently be used for classifying user activity patterns. Fig 2 illustrates the components of our modeling approach to infer life-style patterns from the rich semantics of user check-ins. At first user check-ins are collected. The check-ins contain the names and addresses of the activity-locations that the user has visited. In the next stage, additional contextual information is added to the check-in observations. For example, based on the name of a place, its category can be extracted from a database. In this study, we collect the categories of the activity-locations from Foursquare venue category database. Similarly, from the address of a location we can find the neighborhood of the location. In the next stage, location contexts of user check-ins can be modeled to classify user life-style patterns.
In the present work, as location contexts, we use a combination of the names of the activitylocations, categories of the locations and the surrounding neighborhoods of the locations. We represent individual life-style patterns from two perspectives: i) through the patterns of users' interests in different places and ii) through the patterns of users' visits to different neighborhoods.

Problem Description
Inferring life-style patterns involves finding the complex patterns of individual interests from his/her everyday activity-locations choices. Life-style patterns can be represented as a distribution of location contexts where each context can be represented by the name, category and/or neighborhood of the location. Geo life-style pattern inference problem can be defined as: given the location contexts for n visits as c 1 , c 2 ,. . ., c n of user u, determine the K latent life-style patterns through ϕ k , k 2 1, 2,.., K where each life-style pattern ϕ k is a distribution of location contexts.

Model Description
We present the topic model of individual geo life-style patterns assuming that each user's lifestyle is a distribution of patterns where each pattern is a distribution of location contexts. A graphical representation of the model is shown in Fig 3. The modeling framework extends the topic modeling approach [24]. The probabilistic generative process for the model is summarized as following: 1. For each life-style pattern k 2 1, 2,. . ., K, select a distribution over location contexts ϕ (k) * Dirichlet(β) 2. For each user u 2 1, 2,. . ., U, Given U users' location contexts, K life-style patterns over C unique location-contexts, the objectives of the inference of life-style pattern extraction are to: 1. find the probability of a location-context c given each pattern k, Pðcjz ¼ kÞ ¼ c k where P (cjz = k) is represented with K multinomial distributions ϕ over location contexts of size C.
2. find the probability of a pattern k for a location context in the location visits of user u, The above model views a life-style pattern as a probability distribution over location contexts and user life-style as a mixture of these patterns. From K life-style patterns, the probability of i th location context for a given user u is: where z i is the latent variable indicating the pattern from which the i th location context is drawn, P(c i jz i = j) is the probability of the location context c i under the j th pattern and P(z i = jju) is the probability of choosing a location context from pattern j in the location visits of user u. Intuitively, P(cjz) determines the importance of a location context to a pattern and P(zju) determines the prevalence of the patterns in user u's location choices.

Parameter Estimation
In practice, there are various approximate techniques for estimating the parameters of this model [24,27]. We use the Gibbs sampling approach proposed by [27]. Details of the Gibbs sampling approach can be found in [27]. The joint distribution P(c, z) can be written as First term can be found as: where n c k is the number of times location context c is assigned to pattern k and n ð: The second term can be written as: where n k u is the number of times a location context from user u is assigned to pattern k and n ð: For applying the Gibbs sampling approach, a pattern can be assigned using the following conditional distribution: where n −i is the count excluding the current pattern assignment of z i . Intuitively, Eq 5 expresses two ratios; the first ratio expresses the probability of location context c i in pattern k and the second ratio expresses the probability of pattern k in the life-style patterns of user u. Finally model parameters can be computed as:f Results

Model Selection
For model selection, we first run our algorithm for different number of life-style patterns (K) and compute a metric called perplexity to measure how well the model can predict the unseen data for each run. We then select the optimal number of patterns based on perplexity values. Perplexity of a test dataset, a set of location contexts {c u } for u 2 U test , given a model M is defined as Where N u is the number of location contexts of user u and p(c u jM) can be computed using Eq 1. For estimating perplexity values we randomly split the dataset with 90% of the users in training set and rest 10% in the test set; estimate the life-style pattern model on the training dataset; and compute the perplexity values on the test dataset. Fig 4 shows the results for perplexity measurements for life-style pattern model. A lower perplexity value indicates better performance of the model. It is found that with the increase of the number of life-style patterns the perplexity value reduces however there is no significant improvement beyond a certain number of patterns.

Inferring User Interests
To model user interests to different types of places such as restaurants, stores, grocery shops etc., we use a set of location contexts which mainly include the location categories. For selected location categories, we represent the location contexts by the names of the places. A list of the examples of location contexts used for modeling user interests is presented in Table 2.
Based on the perplexity values, we select K = 100 for estimating the model for user interests to different activity-location contexts. Table 3 presents a few patterns estimated and the probability of the top 10 location-contexts for each pattern reported.
We observe that the activity locations in a given pattern have semantic similarity. For instance, all the locations in pattern 6 are restaurants. Top three locations in pattern 36 are related to highways. Most of the locations in pattern 62 are related to bus or train stations. Top five locations in pattern 49 are either stadiums or sports bars. From this semantic proximity, we can easily label these patterns and infer the latent interests and characteristics of the users contributing to these patterns. Interesting insights found from the results are as follows: • Patterns 1 and 2 represent home, work and maintenance related activity locations.
• Pattern 20 represents the activity locations related to a college or university student.
• Pattern 49 represents user interests towards sports related events.
• Patterns 10, 36, 41 and 62 indicate the modal choice of the users. For instance, patterns 10 and 62 consist of the location contexts related to the transit riders and pattern 36 represents the location contexts related to a car user.
The co-existence of several location contexts and the corresponding probabilities in a given pattern provide useful information. For instance, pattern 6 has all the Eastern Asian restaurants as top location contexts indicating greater user preferences to the foods originated from this region. In pattern 56, we find that those who go to seafood restaurants have higher likelihood to go to Trader Joe's for grocery shopping. Similar inferences can be drawn from other patterns.
To explore the relationship among the patterns and a user's location choices, we report the distribution of location contexts of a user, his or her top most pattern proportions (P(zju) ! 0.05) and the corresponding pattern descriptions (Fig 5). We choose two users, one with only few dominating patterns and another one with more diverse activity location choice patterns. These examples demonstrate how a user's location choices can be modeled as a mixture of patterns as the user has chosen several location categories that belong to a few specific patterns. User 1 has a high degree of regularity in activity location choices as indicated by the lower number of dominating patterns, while user 2 has chosen a wider range of activity locations as indicated by the higher number of dominating patterns.

Inferring User Geo Contexts
To model users' visits to specific parts of the city and infer their life-style patterns from it, we use a set of neighborhoods to represent their location contexts. We collect the information of 195 neighborhoods in 5 boroughs of New York City [28] and label the coordinate for each check-in with the name of the corresponding neighborhood. Using the names of these neighborhoods as location contexts, we run our algorithm. Based on the perplexity values we select K = 50 for estimating the model parameters. Table 4 presents a few of the patterns estimated and the probability of the top 10 neighborhoods for each pattern reported. To understand the spatial meaning of the patterns, we present few patterns in a map of New York City (see Fig 6). Each pattern reveals the predominant neighborhoods based on the check-in information from the data. One of the major findings from these patterns are the geographic proximity among the neighborhoods in each pattern. Even though we have not used the information on the spatial proximity of the neighborhoods as a priori knowledge, the hidden structure is revealed by the patterns of activity-location choices of the users. This means that individuals prefer nearby locations for different activity purposes. Using the pattern proportions for each user, we can infer his or her local neighborhood. Such information might be crucial to reconstruct a user's profile.

Discussion
This work demonstrates the use of social media data to obtain deeper insights into user lifestyles from their activity-location choices. We present a model to infer geo life-style patterns based on contextual information available from check-in observations. These patterns reveal the hidden structure in user interests explaining their behavior. User interests to specific types of shopping places, restaurants, traveling mode, sporting events, and so on can reveal important information on their life-style choices. Using the names of the neighborhoods visited, we also model user geo life-style patterns indicating their geographic contexts. Inferring geo lifestyle patterns has powerful applications from explaining the observed patterns in social media to inferring user socio-economic characteristics.
Geo life-style patterns provide several valuable insights. For instance, a given pattern has similar items-either nearby neighborhoods or similar location categories. In the 100 patterns extracted to infer user interests, location contexts in the same pattern have semantic similarity. While in the 50 patterns extracted to infer user geo contexts, neighborhoods in the same User Check-Ins to Model Urban Geo Life-Style Patterns  pattern have geographic proximity. Why do locations with similar characteristics or nearby neighborhoods are more likely to appear in the same pattern?
The semantic proximity of the items in a given pattern suggests the hidden regularity in user preferences and interests. People are more likely to visit only a few similar types of places. The modality of user preferences to a few location contexts is picked up by the patterns. For instance, in Fig 5A, we find that a user having check-ins from Sushi restaurants has also checkins from Japanese restaurants. One can argue that this phenomenon is merely due to the semantic biases in user check-in behavior. However, this may not be the case. We observe from the patterns that the purposes behind visiting the locations are mostly discretionary ones-representing infrequent visits. Regular check-in users are more likely to check-in from most of those infrequent visited locations-not from only a few of those location categories.
The geographic proximity among the neighborhoods in a given geo context pattern implies the geographic constraints faced by the users. There are costs, related to time and money, involved to travel from one place to another. The further a place is, the more one has to spend to travel to that place. Thus for different activity purposes, people are more likely to visit a few neighborhoods near to where they live or work or have social connections. This suggests a high degree of regularity in user location choices for participating in different activities. Similarly, in a previous study [29] discovering mobility patterns from mobile phone data, it was found that people spend most of their time to a few locations. These findings have remarkable implications in activity-based travel behavior modeling. Researchers have been developing complicated choice models to predict individual activity-location choice behavior without considering the latent interests and spatial contexts of the users. One of the major challenges of estimating these choice models is the huge size of the choice set. To avoid this problem, typically a smaller choice set is generated at random. Our analysis indicates that the user interest patterns to activity-locations and the geo context patterns can give us an alternative and more realistic way to predict user activity-location choice behavior.
Based on their life-style choices, we can segment the study sample and correlate the observed activity behavior patterns with their life-style choices. Thus this analysis provides a behavioral underpinning to mobility and activity behavior observations [11,12] based on social media data. This life-style concept may also provide a richer medium to understand other User Check-Ins to Model Urban Geo Life-Style Patterns dimensions of behavioral patterns observed in social media. For instance, social media data has been used to observe various behavioral aspects in areas including marketing [30,31], social network analysis [22], urban planning [23,32], and health monitoring [33]. Such analyses can be enriched or extended to include life-style choices providing valuable explanation to the observed behavior.
To explain the behavioral patterns, a more traditional approach is to use the socio-demographic attributes of the users. Typically socio-demographic characteristics are used to segment a study sample and representative behavioral patterns are derived for these segmentation bases. Then the overall population is segmented based on similar characteristics available from census data and the representative patterns are assumed for the population segments. This step is needed to scale up from a survey sample to population behavior (e.g., estimate the travel demand for a city). However, these attributes of the social media users are difficult to obtain. Our approach can help to infer those socio-demographic characteristics of the study sample. Using the geo context patterns we next present an idea on how to construct user profiles.
Our objective is to create the socio-demographic profiles of the users based on their geo lifestyle patterns, or in simple words based on where they go. We may argue that people visiting the same neighborhood frequently are more likely to have similar socio-demographic characteristics and an individual's geo context patterns can identify his or her local neighborhood. Similar approaches, popularly known as Geodemographics, have been used in marketing before [34].
The results from geo context patterns provide a distribution of patterns for each user. This distribution can be treated as a feature vector for each user. These distributions of geo context patterns can be used to assign each user a particular neighborhood. We can then use the average socio-demographic characteristics of this neighborhood to construct the user's profile. For instance, if we are interested to infer user income level, the median household income of the neighborhood can be used as the income level for the user. We can assign each user a neighborhood and use the median income for the neighborhood as the income level of the user. In this way we can derive the income distribution of the users.
However, this approach needs to be carefully implemented addressing a number of questions. For instance, how can we choose a dominating neighborhood for a user? Which average socio-demographic characteristics of a neighborhood would be appropriate to be assigned to a user? Furthermore, this approach of assigning an average value to a user would be limited for an area with a heterogeneous population. In that case, inference of socio-demographic attributes can be improved by drawing a value from a distribution instead of assigning an average value.
Finally, although our approach can extract useful information on user life-style choices, it has several limitations which include: 1. There could be demographic biases among social media users that can potentially impact our results. It is found that users of smartphones and location-based services have minor over representation from younger people [35].
2. There might be potential geographic biases if the users prefer to check-in from certain places in the city. In addition, we do not observe the complete sequence of the activities participated by an individual. These geographic biases and lack of activity sequences may ignore some important aspects of user life-style choices.
A few of these limitations may go away with wider uses of social media over the population. For instance, it is expected that with the wide-spread uses of location-based services in the future, sample representativeness of social media datasets will improve. None the less, given the available data, we are able to extract the geo life-style patterns and we anticipate that the observed patterns are not the exclusive traits of the social media users. Further research will be needed to account for missing observations and geographic biases.