# POI Recommendation Scheme Based on User Activity Patterns and Category Similarity
## 3 The Proposed POI Recommendation Scheme
### Analysis Phase
#### 3.3.1 Activity Pattern Analysis  
After the collection of actual data, the proposed scheme derives activity indexes to organize user groups. In the dataset, the user ID, number of check-ins, number of visits to specific locations, and user's primary-activity time period are attributes that can be analyzed to determine user activity. A database is constructed for each user to preprocess the data. Subsequently, the data are used as an index to evaluate user-ID-based activity. Table 4 shows the frequency of user check-ins. The initial activity index is generated by grouping the users' visits into hourly intervals based on the UTC of each visit. UTC is the data logged along with the user's visit to the location. The activity index is used to compute the frequency of visiting specific locations, excluding locations that users pass through in their daily lives. Locations that users pass through include subway stations and banks, which are not suitable for recommendation as POIs to users from other regions \begin{table}
\begin{tabular}{l c c} \hline \hline  & **Attribute** & **Example 1** & **Example 2** \\ \hline User ID & 470 & 1048 \\ Venue ID & 49 bbd6c0f964a52044531 fe3 & 4a5a18d8f964a520b8b91 fe3 \\ Venue category ID & 4 bf58 dd8d48988d127951735 & 4 bf58d8d48988d1f5941735 \\ Venue category name & Arts and Crafts Store & Food and Drink Shop \\ Latitude & 40.71981038 & 40.69369648 \\ Longitude & \(-\)74.00258103 & \(-\)73.99020256 \\ Time period offset in minutes & \(-\)240 & \(-\)240 \\ Coordinated universal time (UTC) & Tuesday 3 April 18:00:09 + 0000 2012 & Saturday 28 April 15:33:25 + 0000 2012 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Example of collected attributes. or travelers. A user-specific location-frequency activity index is produced after excluding these locations. Table 5 shows the results of creating the primary-activity time period by extracting the user ID and UTC from the data attributes. By examining the UTC attributes, we can observe the user's history of visiting a particular location across multiple time periods. Using the time density function, we detect the primary-activity time period of a specific user. In the case of the primary-activity time period, only the required time (h) is extracted and preprocessed, as it serves as an index specifying the year, month, day, hour, minute, and second. The attributes are formatted according to the user after the three activity indicators are extracted and created. Users are clustered based on the formatted activity table. The proposed scheme assesses user activity by utilizing the preprocessed results. It clusters users based on the FCM algorithm and activity indicators. The FCM algorithm is a clustering algorithm in which feature vector data and similarity matrix data are typically employed as the input [9]. A feature vector dataset comprises the features of each data point, including the \"number of visits to locations\", \"frequency of visits to specific locations\", and \"primary-activity time period\". The similarity matrix denotes the degree of similarity between each data point, which can be calculated using either Euclidean distance or cosine similarity [12]. In this paper, we calculate by cosine similarity. The matrix is created by calculating the similarity between the feature vectors. These vectors, representing the number of visits, frequency of visits, and primary-activity time period, are then used in the FCM algorithm to generate clustered results. Figure 4 shows the results of clustering users. The feature vector is reduced to two dimensions for visualization purposes. As a result of clustering, all users are grouped into either highly active (cluster 1) or inactive (cluster 0) categories. The grouped results are then utilized to apply the recommendation algorithm. \begin{table}
\begin{tabular}{c c} \hline
**User ID** & **Frequency of Check-Ins** \\ \hline
354 & 1843 \\
293 & 1769 \\
185 & 1530 \\
84 & 1187 \\
315 & 1144 \\ \(\ldots\) & \(\ldots\) \\
671 & 12 \\
959 & 9 \\ \hline \end{tabular}
\end{table}