# An Empirical Recommendation Framework to Support Location-Based Services +
## 4 Methodology
### User Profile Generation  
#### 4.1.1 Discovering Interest  
For interest discovery for each user, we have to analyze their activities. People visit various spots for different reasons. Some of them are for daily purposes and some of them are for entertainment purposes. Whenever user posts about the spot they visited, it defines as a check-in spot. Each check-in spot has its own information. This information tells about the category of that place. To discover the user interest we have to cluster the check-in spots into a different category. To cluster into different groups, we used a familiar clustering algorithm known as Density-Based Spatial Clustering of Applications with Noise (DBSCAN) [16]. It requires two parameters \((\epsilon,MinPts)\) for DBSCAN. Where \(\epsilon\) defines the distance to a point if the point can be a neighborhood point of a cluster and \(MinPts\) defines the minimum number of neighbor points within the \(\epsilon\) radius. This algorithm also has three data points.  
* **Core point:** within the \(\epsilon\) radius, when a point has more neighbor than the \(MinPts\) it is called core point.
* **Border point:** it defines the fewer neighbor points than the \(MinPts\).
* **Noise:** noise is point which stays outside of the \(\epsilon\) radius.  
Algorithm 1 represents the procedure of DBSCAN.  
Figure 2: System Architecture.  
Steps of DBSCAN:  
* We select an arbitrary unvisited point and extract all the neighboring points within the radius \(e\).
* When the number of neighborhood points exceed \(MinPts\), we try to find the border points with the less dense area to form a cluster and marked them all as a visited point.
* Then we start with a new unvisited point and recursively processed steps 1 and 2 to find another cluster.  
From Figure 3 we can see that in the bottom layer there are some check-in spots visited by a user that is not categorized. DBSCAN provides us the clusters shows in the middle layer. For example, 'Wallace Mall', 'Jamuna market', and 'New Market' all are the market places that are clustered in the market category with'shopping' purpose as the parent category. similarly, 'Boga Lake', 'Rodgers Lake', and 'Saint-martin Island' can be grouped into the 'traveling' category. People used to go to market or store for shopping purposes as well as zoos and parks for recreation purposes.  
First, we eliminate the null values, all punctuations, and symbols if there are any. Then encode the parent category with the Label Encoder so that: 'Recreation' = 0, 'Food' = 1, 'Traveling' = 2, and so on. We tokenize the words and then with the Porter Stemmer of NLTK try to find the root of a word. The \(TF\)-\(IDFvectorizer\) vectorizes the features to reflect how important a word is to a document in a collection. Finally, we perform DBSCAN to cluster all the place types into 11 categories and measure the Completeness and Homogeneity Score. We construct a table for two users A and B about their check-in spots and categorized them using the algorithms. From Table 3 we can easily find out each user's interest profile according to their previous visiting places.  
As we have the parent category of each visiting place for the individual user from Table 3, now we calculate the percentage of each visiting parent category. Then we make the order of category from high to low which defines the priority of interest for the user. In case of the same priority score, we make the list arbitrary. Table 4 shows the generated profile for each user and defines the priority of interest on their list.