A Context-Aware Recommender System for Personalized Places in Mobile Applications

Selecting the most appropriate places under different context is important contribution nowadays for people who visit places for the first time. The aim of the work in this paper is to make a context-aware recommender system, which recommends places to users based on the current weather, the time of the day, and the user’s mood. This Context-aware Recommender System will determine the current weather and time of the day in a user’s location. Then, it gets places that are appropriate to context state in the user’s location. Also, Recommender system takes the current user’s mood and then selects the location that the user should go. Places are recommended based on what other users have visited in the similar context conditions. Recommender system puts rates for each place in each context for each user. The place’s rates are calculated by The Genetic algorithm, based on Gamma function. Finally,mobile application was implemented in the context-aware recommender system. Keywords—recommender system, context, context-aware, genetic algorithm, gamma function.


I. INTRODUCTION
The massive scale of data on the Internet today makes it difficult for users to find relevant information.Thus, the information is customized according to the users' needs and preferences.Often the application of recommender systems uses Collaborative filtering and content of the list.In a scenario of mobile devices, customization of information is more important, because of the restrictions on mobile devices about the displays and input capabilities, bandwidth, etc.For example, the traveler with PDA, smart phones or pocket PCs needs access to the weather at the destination or have a recommendation for a hotel in the neighboring region.It is recommended to customize not only the use of user profiles in advance, but also a context such as the current location, time of the day, the current weather, or the mood of the user.Context can defined as the information that can be used to describe the situation entities i.e., person, place, or subject, which is relevant to the interaction between the user and the application, including the user and the application themselves [8].The first challenge to generate context recommendations is learned via identifying the contextual factors such as weather that affect the ratings and thus that are worth considering.Second, get a representative set in the context of Rates ,i.e., rankings under different contextual circumstances is free from the context rankings.Finally, the expansion of conventional recommender systems is to exploit the additional information fields in the evaluation context.In this paper, a novel algorithm was performed , called Context-Aware Genetic Recommender System (CAGRS).CAGRS system consists of five modules: 1-Collecting Stay Points, 2-Clustering Stay Points, 3-Determining Popular Places in each cluster, 4-Getting the weather and time of the day in each Stay Point, and 5-Getting frequency of the weather and time of the day in each cluster.CAGRS take user's parameters, such as (current user's location, user's mood) and determine the current weather and time of the day.CAGRS uses Genetic Algorithm for predicting rates of each place based on gamma function as the fitness function.Genetic Algorithm (GA) considered as the optimization an algorithm which gives an optimal solution to most problems.In the field of Artificial Intelligence, GA is a search heuristic that uses the process of natural selection (survival of the fittest) [9].Genetic algorithm puts rates in each place according to different context conditions and for each user.The contributions of this paper are: 1-Developing a context-aware recommender system based on a Genetic algorithm with gamma function.
2-Rating places by using number of visits for many users to each place and by examining context conditions in each one.
3-Recommending the best place that user should go based on the user's mood or the current weather and time of the day in user's location.This paper is divided as follows: Section 2 contains summarization of related work; Section 3 contains steps of how the system runs; Section 4 discusses experimental results and discussions.Finally, Section 5 concludes the paper and presents future works.

II. RELATED WORK
Yong Zheng and Bamshad Mobasher [19] proposed context match as a new contextual modeling technique and study different ways to represent context similarity and include it into the recommendation.They showed how context similarity can be incorporated into the sparse linear method and matrix factorization algorithms.www.ijacsa.thesai.orgQiang Liu and ShuWu [6] proposed Contextual Operating Tensor (COT) Model, which denoted the public semantic effects of contexts as a contextual operating tensor and denotes a context as a hidden vector.Then, to model the semantic operation of a context grouping, they created contextual operating matrix from the contextual operating tensor and hidden vectors of contexts.Thus, hidden vectors of users and items can be used by the contextual operating matrices.Wolfgang Woerndl and Christian Schueller [12] recommended mobile applications to users based on what other users have used in the same context.The idea is to make a hybrid recommender system to manage the extra complexity of context.Users can choose among different content-based or collaborative filtering factors, including a rule-based module, using information on point-of-interests in the vicinity of the user, and a factor for the mixing traditional collaborative filtering.Sabri Boutemedjet and Djemel Ziou [2] proposed a new framework for the recommendation of context-aware visual documents by modeling the needs of users, and context, as well as the collection of visual document together in a unified model.It also directed the user need for a variety of recommendations.Matthias Braunhofer, Mehdi Elahi, and Francesco Ricci [3] presented a new context-aware mobile recommender system for places of interest (POIs).Unlike current systems, which study users' preferences solely from their earlier ratings, it also considers their personality -using the Five Factor Model.Personality developed by asking users to complete a short and entertaining questionnaire as part of the registration the process, and then used in: (1) an active learning element actively acquires ratings-in-context for POIs that users are likely to have practiced, hence decreasing the stress and annoyance to rate (or skip rating) items that the users don't know, and (2) in the recommendation model that builds based on matrix factorization and, therefore, can deal with unrated items.Keith Cheverst and Nigel Davies [13] defined their skills of developing and estimating GUIDE, an intelligent electronic tourist guide.The GUIDE system has built to overwhelmed many of the limits of the old information and navigation tools available to city visitors.For example, group-based tours are inherently inflexible with fixed starting times and static durations and are constrained by the need to satisfy the interests of the benefits rather than the specific interests of individuals.Following a period of needs capture, involving experts in the field of tourism, they developed and installed a System for use by visitors to Lancaster.The system combines mobile computing technologies with a wireless infrastructure to present city visitors with information tailored to both their personal and environmental contexts.Barry Brown and Matthew Chalmers [4] described as a light weight portable system designed for the exchange of entertainment.This system allowed Visitors to the city to share experiences with others, through disc Computers that share pictures, audio, and location.Collaborative filtering algorithm used historical data in previous visits that use images, the web pages and recommended places for visitors, bringing the media together online with the city's streets.Pedro G. Campos and Ignacio Fernandez-Tobias [5] conducted an empirical comparison of several pre-filtering, post-filtering and contextual modeling approaches on the movie recommen-dation field.To acquire confident contextual information, they made a user questionnaire where participants were asked to rate movies, stating the time and social companion with which they preferred to watch the rated movies.Chein-Chung Hwang1, Yi-Ching Su [11] described a new recommender system, which performed a genetic algorithm to learn personal preferences of customers and provide tailored suggestions.Karthik Srinivasa Gopalan, Senthil Nathan developed the use of context capture on the users devices as a method of learning all the user activity patterns and using these patterns to generate content recommendations.They proposed a new [9]recommendation system based on an evolutionary algorithm that evaluates new content based on multiple objectives.Daniel Siewiorek, Asim Smailagic [1] developed SenSay which is a context-aware mobile phone that adjusts to dynamically changing environmental and physiological shapes.In addition to operating ringer volume, vibration, and phone alerts, SenSay can provide faraway callers with the ability to communicate the urgency of their calls, make call offers to users when they are idle, and provide the caller with reaction on the current status of the SenSay user.Some sensors including accelerometers, light, and microphones are mounted at numerous points on the body to provide data about the users context.Mark van Setten and Stanislav Pokraev [15] defined the context-aware mobile tourist application COMPASS that adjusts its services to the users requirements based on both the users interests and his current context.To provide contextaware recommendations, a recommender system has been joined by a context-aware application stage.They described how this integration has accomplished and how users felt about such an adaptive tourist application.Anand Ranganathan and Roy H. Campbell [14] argued that computing environments must offer middle ware support for context-awareness.They also planned a middle ware that facilitates the progress of context-aware agents.The middle ware allows agents to gain contextual information easily, reason about it using different logics and then adjust themselves to changing contexts.Another key issue in these environments is letting autonomous, varied agents to have a common semantic understanding of contextual information.This middle ware attacks this problem by using ontologies to define different kinds of contextual information.Jakob E. Bardram [17] presented the strategy of a contextaware pill container and a context-aware hospital bed, both of which responds and adapts according to what is happening in their context.The applications have been assessed in a number of workshop with clinicians and patients.Based on this experiential work of designing, developing, and evaluating context-aware clinical applications, the paper plans some key design principles for a context-awareness framework, supporting the development and deployment of context-aware clinical computer applications.Yong Jae Lee and Kristen Grauman [18] proposed to power information about earlier learned categories to enable more correct discovery.They introduced a new object graph descriptor to encode the layout of object-level co-occurrence designs about an unfamiliar area, and showed that by using it to model the communication between image's known and unknown objects they can better notice new visual categories.Rather than mine for all categories from scratch, their method www.ijacsa.thesai.orgFig. 1: System Model can frequently identify new objects while drawing on useful signs from familiar ones.Xiping Hu, Xiong Li [10] proposed a multidimensional context-aware social network design which aims to offer a mobile ecosystem to enable context awareness in the development and utilization of mobile crowd sensing applications.This mobile ecosystem is made to provide context awareness skills for different roles in the system and facilitate interactions between them.This system can ease the expansion of contextaware mobile applications, and enable context-aware mobile crowd sensing considering environmental, personal, and social information.They offered a flow of context-aware results designed on this system, and highlight the orchestrations and advantages of different context-aware structures in the system for different types of users in mobile crowd sensing.Po-Han Wu and Gwo-Jen Hwang [20] provided a contextaware mobile learning system established for nursing training courses.During the learning events, each student is equipped with a mobile device; moreover, sensing devices are used to sense whether the student has conducted the operations on the accurate location of the dummy patients body for evaluating the physical status of the specified disease.The learning system not only guides specific students to make each operation of the physical valuation procedure on dummy patients, but also provides direct feedback and extra materials to them if the operations or the operating sequence is incorrect.

III. CONTEXT-AWARE GENETIC RECOMMENDER SYSTEM (CAGRS)
In this section, CAGRS system will be discussed in details and illustrate all system's modules as shown in figure 1. CAGRS algorithm consists of five main modules: 1-Collecting Stay Points, 2-Clustering Stay Points, 3-Determining Popular Places in each cluster, 4-Getting the weather and time of the day in each Stay Point, and 5-Getting frequency of the weather and time of the day in each cluster.These modules will be explained in details as follows: A. CAGRS Modules 1) Collecting Stay Points: From the work stated in [16], the stay points have resulted from GPS trajectories that are collected by Microsoft Research Asia's Geolife project 1 .To calculate latitude and longitude of a stay point, the average will use as GPS points that are around specific locations, as illustrated for the following equations ( 1) and ( 2): Sp lat and Sp long are average latitude and longitude of GPS points in stay point in sub-trajectories.These stay locations might be hotels, restaurants, historic places, homes, schools, etc.The total number of resulted stay points is 14391 for all users.
2) Clustering Stay Points: After collecting stay points, now these stay points need to be collected in different clusters.Clustering is performed using DBSCAN algorithm.Densitybased Spatial Clustering of Applications with Noise (DB-SCAN) is a density based clustering algorithm, using top-down approach.It groups together points that are packed together (points with many nearby neighbors).We choose DBSCAN algorithm because it does not need to know the number of clusters in the data as opposed to k-means.DBSCAN has a concept of noise, and is to deal with outliers.DBSCAN needs just two parameters and is mostly insensitive to the ordering of the points in the database.By clustering stay points using DBSCAN algorithm, points that are close to each other with distance less than will be obtained in the same cluster and others considered as noise points.All 14391 stay points were collected in 172 clusters if =30 meters [9] as shown in figure 2. 3) Determining the Popular Places in each cluster: Now, the center of each cluster needed to be determined.Equations ( 3) and ( 4) are used to calculate the latitude and longitude for centers by calculating the mean value of all stay points(latitude, longitude) in each cluster.
Now, every point in the center of each group must be converted into meaningful titles by getting the names of each place.The reverse geocoding process takes latitude and longitude as input and returns the site of this point as output.There are different APIs like Google Geocoding API, My Geoposition API, GeoNames API, Nominatim open stream map, etc. GeoNames API was used for mapping each point in its address 2 .Can not set all points in the name of the place.Only 166 locations from 172 points marked with their places names.
4) Getting the weather and time of the day for each stay point in the cluster: In this step, the history of weather needs to be determined and the time of the day in each stay point (location).There are many APIs to determine this information (i.e., Open Weather Map, World Weather Online, National Climatic Data Center,etc.).All these APIs take the location information as input (latitude, and longitude) and take the date information (time, date) and get all weather information as output.This paper used (Weather Underground API) 3 .

5)
The Optioning frequency for the weather and time of the day in clusters: Finally, in this step calculates the most frequent weather and time of the day in each cluster.Each popular place belongs to each cluster will be marked by the most frequent weather and time of the day in this cluster.

B. User Parameters
As shown in figure 1, CAGRS system takes user parameters, such as (Weather, time of the day and user's mood).As an example, if the mood of the user is (Sad), then the user may need to go to cinema to watch a comedy movie.The system ask user to put his/her current mood, then it recommends the best appropriate place for a user's mood.for example, if the weather is sunny the user may need to go to a place with air condition, if the weather is rainy, the user need closed place.As shown in Table I, each popular place stored with weather and time of the day.To get this information in to practice, the location of the user needs to be determined and the current weather/time of the day in a user's location using Google map API.When the current Weather/Time of the day in a user's location match the Weather/Time of the day for a popular place, CAGRS will recommend this popular place to this user and will show the direction between user's location and the recommended popular place, as shown in Figure 3.As shown in Table II, each type of user's mood stored with the most appropriate place.Figure 4 shows how to take the mood of the user and show the recommended place according to this mood.Finally, Recommender System will give rates for each place according to each user and each context state.There are many methods used to determine these rates (i.e., Genetic Algorithm, Matrix Factorization).This paper used Genetic Algorithm [9].The resulted data stored in 3D Cube with the following dimensions (user, place, context) as shown in Figure 5. Figure 6 shows the Place Rating Matrix that present rates for each place based on users and context.The value of the place's rate is calculated using the frequency of each context state (weather, time of the day, and user's mood) in each cluster.For unknown place rating values,The Genetic algorithm will predict these values.The Genetic algorithms (GAs) are stochastic search methods that guide a population of solutions using the principles of growth and natural genetics.Extensive research has been achieved exploiting the robust properties of genetic algorithms and representing their capabilities across a broad spectrum of optimization problems, including feature selection and weighting tasks.GAs are modeled loosely on the principles of the evolution via natural selection, employing a population of individuals that undergo selection in the presence of variation-inducing operators such as mutation and crossover.A fitness function is used to evaluate individuals, and generative success varies with fitness.Architecture of Genetic Algorithm is as follows: 1-Initial population: Two Random Place Rating matrices will generate from R min to R max .This initial population's format was chosen based on Place Rating Matrix's format illustrated in figure 6.
2-Fitness Function: Fitness function used in genetic algorithm is a Gamma Function as in equation (6).
3-Crossover method: Offspring is generated from two matrices parents by using uniform crossover.Offspring is created from selected individuals by selecting random place P i , random user U j and random context C k .Then, the block of first parent matrix that before i, j, and k is exchanged with block of second parent matrix that after i, j, and k. 4-Selection approach: Selection of the best individuals is based on the minimum value of fitness function.Algorithm will be stopped when the value of fitness function reaches the minimum value for specific matrix.The resulted matrix is called optimal Place Rating Matrix with no null values.

IV. COMPARISONS AND EXPERIMENTAL RESULTS
In this paper, the Genetic Algorithm was performed that based on Gamma Function on 166 places, 182 users, and 12 different context states.The results as shown in Table III, are the final matrix that consists of (User, Place, Context, Rate).The results consists of 19116 records.Experimental results are run on Intel Core i5 Processor, 4.00 GB Ram and Windows 7 operating system.PHP programming language and MATLAB were used for obtaining the results.We divided the dataset in 5 small datasets with 3823 records in each dataset.Table IV and Figure 7 show the comparisons when performing 1 run ,3 runs,5 runs and 10 runs in each 5 small datasets.To compare the results with data from users' reviews, 1539 responses were collected by making a simple questionnaire.Figure 8 shows the frequency of places in each weather state.We measured the Mean Absolute Error (MAE) as in equation 7 between the resulted data from algorithm and the real data that was taken by questionnaire.for each place from real data results and from experimental data results and shows the MAE value between the two results.Figure 9 shows the MAE results between on Google questionnaire results and experimental from CAGRS algorithm results.
We compared results generated from Genetic Algorithm (GA) based on Gamma function with the resulted data from Distributional-Semantics Pre-filtering (DSPF) based on Matrix Factorization (MF) and K-Means clustering algorithm [7]. Figure 10 and Table V show the MAE between two sets.We performed in CAGRS system a Gamma Function as fitness function in Genetic Algorithm.In Table VI and Figure 11, The results that based on gamma function compared with results from Root Mean Square error in [9] and were compared with Prediction Accuracy in [14].

V. CONCLUSION AND FUTURE WORK
In this paper, the context aware mobile recommender system learns user preferences from the past ratings as well as their personality.This information is utilized to generate high-quality recommendations for places of interest in light of contextual goal situation.The implementation of the system have described, regarding design, recommendation logic, user interface, and features.for future work, it is nice to make many improvements to the system.First, recommendations to the user need to be made when the current situation seems   appropriate, without relying on explicit user's request.In addition, taking advantage of human emotions in the process of recommendation know the current user activity that can be drawn from wearable devices such as smart watches and smart chips.Finally, developing roads to the user's personal conclusion by the personal characteristics of the users of the features of Facebook or using a mobile phone.

Fig. 3 :
Fig. 3: Recommended Place based on the current weather

Fig. 4 :
Fig. 4: Recommended Place based on the current user's mood

Fig. 11 :
Fig. 11: Comparing results among gamma function, root mean square error, and prediction accuracy

TABLE I :
Weather and time of day in each location

TABLE II :
Appropriate places for each user's mood

TABLE III :
Experimental Results

TABLE IV :
MAE comparing results

TABLE V :
the MAE between GA with gamma function and DSPF-MF-Kmeans

TABLE VI :
Comparing results among gamma function, root mean square error, and prediction accuracy