Matrix Factorization Collaborative-Based Recommender System for Riyadh Restaurants: Leveraging Machine Learning to Enhance Consumer Choice

: Saudi Arabia’s tourism sector has recently started to play a signiﬁcant role as an economic driver. The restaurant industry in Riyadh has experienced rapid growth in recent years, making it increasingly challenging for customers to choose from the large number of restaurants available. This paper proposes a matrix factorization collaborative-based recommender system for Riyadh city restaurants. The system leverages user reviews and ratings to predict users’ preferences and recommend restaurants likely to be of interest to them. The system incorporates three different approaches, namely, non-negative matrix factorization (NMF), singular value decomposition (SVD), and optimized singular value decomposition (SVD++). To the best of our knowledge, this is the ﬁrst recommender system speciﬁcally designed for Riyadh restaurants. A comprehensive dataset of restaurants in Riyadh was collected, scraped from Foursquare.com, which includes a wide range of restaurant features and attributes. The dataset is publicly available, enabling other researchers to replicate the experiments and build upon the work. The performance of the system was evaluated using a real-world dataset, and its effectiveness was demonstrated by comparing it to a state-of-the-art recommender system. The evaluation results showed that SVD and NMF are effective methods for generating recommendations, with SVD performing slightly better in terms of RMSE and NMF performing slightly better in terms of MAE. Overall, the ﬁndings suggest that the collaborative-based approach using matrix factorization algorithms is an effective way to capture the complex relationships between users and restaurants.


Introduction
Saudi Arabia has become increasingly reliant on its tourism sector as an economic driver. The study in [1] explores the link between tourism and economic growth in Saudi Arabia and concludes that tourism has a significant impact on promoting economic growth in the country. The food service sector in Saudi Arabia is expected to experience significant growth, with a projected increase in value from USD 14.16 billion in 2022 to USD 30.47 billion by 2029, at a CAGR of 11.57% in the forecast period [2].
The restaurant industry in the capital city of Riyadh has experienced rapid growth in recent years [3,4], resulting in increased competition and making it challenging for customers to choose from the large number of restaurants available.
Furthermore, the exponential growth of information and content on the Internet has made it increasingly challenging for users to find relevant search results [5] while simultaneously presenting a challenge for marketers to make their products and services stand out. To address this challenge, recommender systems can be used to provide personalized restaurant recommendations to customers based on their preferences.
Recommender systems are commonly employed in electronic tourism to offer various services, such as suggesting trips and activities, presenting lists of points of interest (POIs)

Matrix Factorization for Recommender Systems
There are various paradigms that can be used to implement recommender systems [11]. These include collaborative filtering (CF), content-based filtering, and hybrid filtering, the last of which combines multiple paradigms to improve recommendation accuracy and overcome the limitations of individual approaches.
Content-based filtering is a commonly used approach in which recommendations are made based on the similarities between the features of an item and a user's preferences [12]. One example would be promoting French restaurants to customers who have expressed an interest in French cuisine. This method, however, has problems in capturing the delicate relationships between consumers and eateries.
On the other hand, CF is a technique frequently employed in recommender systems that predicts a user's preferences based on the preferences of other users who have similar tastes [13]. One of the most effective recommendation techniques among CF-based methods is matrix factorization (MF) [10,14,15].
In its simplest form, matrix factorization for recommender systems represents both users and items as vectors of latent factors, which are derived from the user-item rating matrix. When there is a strong correlation between the latent factors of a user and an item, it results in a recommendation of that item to the user [16]. Unconstrained gradient descent is typically used to learn the feature components of the user and item factor matrices [17].
MF has been utilized in several domains, such as recommending movies, suggesting music, and providing restaurant recommendations [6]. The flexibility of matrix factorization to handle huge and sparse datasets distinguishes it from other collaborative filtering systems [16]. On large and sparse datasets, other collaborative filtering techniques, such as k-nearest neighbor (k-NN) and user-or item-based collaborative filtering, may not perform as well due to the sparsity problem [5].
Matrix factorization also has an advantage in handling implicit feedback, like user views or clicks, as well as explicit feedback, such as ratings or reviews. This feature enables matrix factorization to capture a broader range of user preferences and behaviors, resulting in more precise and diverse recommendations [16].
Typical matrix factorization models include non-negative matrix factorization (NMF) [18], singular value decomposition (SVD) [19], and optimized singular value decomposition (SVD++) [16]. NMF decomposes the original matrix into two smaller non-negative matrices [18]. SVD is a widely used algorithm for solving real and complex metrics, as well as for rate estimation and canonical correlation analysis [20]. SVD++ [19] is an advanced version of the SVD model that takes into account implicit feedback. Implicit feedback includes information on the user's preference history, which provides details on the items for which the user has expressed a preference, either explicitly or implicitly.

Related Works
Recommender systems have become increasingly prevalent in a variety of domains, including e-commerce, music, movies, and restaurants. In the tourism and hospitality sector, several studies have explored different approaches to recommending restaurants to users. One such study [21] introduced a machine learning-based recommender system. Their dataset, collected from TripAdvisor.com, included hotel information, users' reviews, and ratings of the hotels. The authors used amenities as features and also considered user ratings for each hotel as a feature. They further detected the sentiment of the reviews using natural language processing (NLP) techniques. The authors implemented five different NLP techniques, including probabilistic neural network (PNN), back propagation neural network (BPN), support vector machine (SVM), and linear discriminate analysis (LDA), and achieved an accuracy of 92.45%.
Moreover, the researchers in [22] proposed a location-aware personalized traveler assistance (LAPTA) system that integrates user preferences and GPS to generate personalized and location-aware recommendations for tourists. The system separates data obtained from Google locations into name and category tags and fetches keywords from the user's input based on their past research behavior. LAPTA uses the K-Nearest algorithm to match name and category tags with the user's input to generate personalized suggestions. Experimental results showed that LAPTA could provide more reliable and accurate recommendations compared to reviewed recommendation applications, making it a valuable tool for tourists seeking personalized recommendations.
In [23], the authors aimed to explore the relationship between reviewers' evaluations and overall satisfaction. The authors collected their dataset from Yelp, a restaurant review website, and were interested in overall numerical ratings and textual comments. They implemented a Latent Aspect Rating Analysis (LARA) with modifications using NLP, machine learning, and regression analysis to predict the overall numerical rating of an entity. The resulting F1-scores for each class were presented for each city, with a range of F-scores of 0.80-0.88 for rating, 0.69-0.87 for overall satisfaction, and 0.73-0.87 for price.
Fakhir et al. [24] developed a restaurant recommender system using a user-based collaborative filtering approach. They used a dataset provided by Zomato, consisting of 50,998 ratings, 86 restaurants, and 593 users. The system aimed to provide recommendations based on the similarity of preferences for the target user and all existing users by calculating the weighted coefficient for the similarity between users and similarity of user attributes. The performance was evaluated using the mean absolute error (MAE) metric through two scenarios: user-based collaborative and user-based collaborative with user attributes. The performance showed 1.4 MAE for the first scenario and 2.1 for the second scenario, indicating that the system performs better without user attributes.
Reference [25] proposes a recommender system for food-delivery applications based on the number of orders. The system uses the nearest-neighbor technique to calculate a client's preferred restaurants and analyze other clients with similar buying patterns. The paper also proposes a performance metric based on real restaurant sales. The proposed system was tested on a real dataset and was found to give an average of 7.7 options out of 187 available. The system was compared to other state-of-the-art recommendation techniques and was found to perform better. The study also found that the majority of the works are either based on surveys or rely on data from social networks like TripAdvisor, Zomato, Yield, and others.
In addition, Reference [26] proposes a context-aware food recommender system which provides personalized food recommendations based on a user's profile, physiological signals, and sensing environmental information around the dining table in real time. The proposed system aims to provide appropriate food recommendations for each individual's health at the table in real time, making it suitable for well-being care applications.
Furthermore, Visit Saudi [27] represents the official tourism platform for the Kingdom of Saudi Arabia. It serves as a comprehensive resource for tourists seeking information about popular destinations, activities, events, and travel tips for visiting Saudi Arabia. One of its features is "Plan Your Trip", which recommends cultural events, local cuisine, and other relevant topics related to Saudi Arabia.
Recent studies have noted the incorporation of deep learning techniques such as neural networks and convolutional neural networks into restaurant recommender systems. These techniques can capture complex patterns and relationships in the data and can handle large and sparse datasets. For example, Reference [28] proposes a restaurant food recommender system that uses optical character recognition (OCR) technology and a transformer-based deep learning model to recommend food dishes to users based on their nutritional needs. The system is able to rank the food dishes in terms of the input search key (e.g., calorie, protein level) and can also rank unseen food dishes. The proposed system was evaluated using a self-constructed menu dataset, known as MenuRank dataset, and achieved promising results with accuracy ranging from 77.2% to 99.5%. The evaluation metrics used were normalized discounted cumulative gain (NDCG), cross entropy loss (CEL), and accuracy (ACC).
In addition, the work in [29] proposes an explainable food recommender system that uses a deep learning-based image clustering method to recommend food based on visual content and justify the recommendations. The system also introduces a new similarity score based on a tendency measure that quantifies the extent to which the user community prefers a given food category, and a rule-based explainability to enhance transparency and interpretability of the recommendation outcome. The experiments on a crawled dataset show that the proposed method enhances recommendation quality compared to other existing methodologies for food recommendation.
Context-aware recommender systems that consider the context in which the recommendation is made, such as the time of day, weather, and user location, have also been gaining attention. These systems can provide more relevant and personalized recommendations to users. For example, a recent study [30] proposed a social network mobile application for tourism using a hybrid recommender system that incorporates user location and time of day to recommend restaurants to users. Their approach achieved high accuracy and improved the relevance of the recommendations. In addition, the authors of [31] proposed a serendipity-oriented personalized trip recommendation (SOTR) algorithm to address the challenges in trip recommendation. The proposed algorithm considers similarity between points of interest (POIs) and category differences among consecutive POIs and uses serendipity to recommend a trip with high user satisfaction. The algorithm was evaluated using real-life and Foursquare datasets, and the results showed that it outperforms various recommendation methods by satisfying user interests in the trip.
Furthermore, the authors of [32] proposed a method to extract user food preferences from their online comments about restaurants. The method is based on natural language processing techniques for processing the text of user comments and extracting the desired food names. The semantic similarity approach has been exploited to conceptually cluster food names. The clustering results with the Wu-Palmer method shows higher precision. To obtain the opinion of the user regarding each food item on the menu, sentiment analysis is performed to indicate whether their opinion is positive or negative. The proposed system suggests surrounding restaurants to users with an accuracy of 92.8%.
Matrix factorization is another popular approach in the recent literature for restaurant recommendations. Several studies have explored the use of matrix factorization for improving the accuracy and diversity of restaurant recommendations. For example, the authors of [33] proposed a hybrid recommender system that considered visual features in addition to text-based information to predict favorite restaurants. The recommender system was implemented using three techniques: factorization machine (FM), matrix factorization (MF), and Bayesian personalized ranking matrix factorization (BPRMF). The dataset was collected from a restaurant social platform that consists of user information, restaurant information, and blog articles written by users about their visited restaurants. The authors used blog articles and extracted 2118 keywords related to restaurants and food as text-based information and images embedded in the articles as visual information. The performance was evaluated based on the three selected techniques (FM, MF, and BPRMF) enhanced by content-based features. The results showed that the enhanced BPRMF and enhanced FM performed better than other techniques.
Another recent approach in the literature is graph-based recommender systems. These systems represent users and items as nodes in a graph and use graph-based algorithms to make recommendations. For example, Reference [34] focuses on developing an application named "Travel Best" that extracts check-ins from users' Facebook accounts to generate trend-based suggestions for location and restaurant recommendations. The application utilizes shortest path, longest path, and most traveled route algorithms to suggest locations within a city based on Facebook checked-in data. Additionally, the study utilizes opinion mining to provide relevant restaurant ratings based on food quality, service, and ambiance, unlike overall ratings usually provided by other applications. The results are visualized using a graph database. Overall, the proposed approach provides personalized location and restaurant recommendations based on users' behavior, which can help users plan their trips more effectively. Another recent study by [35] introduces a new dataset named CADT (city-attraction dataset for travel) to explore the use of conversational recommender systems (CRS) in tourism attraction and city recommendation. The authors propose a new framework named RUI (representation, understanding, interaction) to make travel recommendations using a path-seeking process on the given knowledge graph. Both automatic and human evaluations were conducted, which demonstrated the effectiveness of the RUI framework. The study presents the first knowledge graph-based CRS for city and tourism attraction recommendations in the travel domain.
Our study builds upon these recent studies by proposing a collaborative-based recommender system using a matrix factorization algorithm for Riyadh restaurants. The system showed that the quality of the recommendations overcome the baselines. Our system has the potential to improve the overall dining experience for customers and increase revenue for restaurants in Riyadh.

Materials and Methods
The proposed approach is illustrated in Figure 1 and consists of the following steps. Firstly, data collection and preprocessing were performed on user reviews and ratings from the popular restaurant review social media platform, Foursquare.com. The collected data were then cleaned, normalized, and transformed into a suitable format for analysis through data preprocessing.
In the third step, evaluation was carried out to assess the accuracy of the recommen dations. Metrics such as root mean squared error (RMSE) and mean absolute error (MAE were used to measure the difference between the actual and predicted ratings. This al lowed us to determine how well each algorithm performed in generating accurate recom mendations. The fourth step involved comparison, where the performance of the collaborative filtering methods (NMF, SVD, and SVD++) was compared to that of a popularity-based recommender system. The popularity-based recommender system recommended the most popular restaurants to all users, without considering the specific preferences of each user. Finally, the system was deployed by integrating it into a website where users could receive personalized restaurant recommendations.  The next step involved implementing four recommendation algorithms, namely, content-based, NMF, SVD, and SVD++.
In the third step, evaluation was carried out to assess the accuracy of the recommendations. Metrics such as root mean squared error (RMSE) and mean absolute error (MAE) were used to measure the difference between the actual and predicted ratings. This allowed us to determine how well each algorithm performed in generating accurate recommendations.
The fourth step involved comparison, where the performance of the collaborative filtering methods (NMF, SVD, and SVD++) was compared to that of a popularity-based recommender system. The popularity-based recommender system recommended the most popular restaurants to all users, without considering the specific preferences of each user. Finally, the system was deployed by integrating it into a website where users could receive personalized restaurant recommendations.

Data Collection and Prepossessing
This section describes the selected dataset and the preprocessing steps taken before using it in the system.
The dataset was collected from user reviews and ratings on the popular restaurant review social media platform, Foursquare.com. Web scraping is the process of automatically extracting data from websites using software tools called web scrapers [36]. This dataset includes various features such as restaurant names, ratings, tips, and locations for restaurants based in Riyadh city, totaling 14,520 unique values. The dataset is publicly available on Kaggle.com (www.kaggle.com/datasets/fahd09/riyadh-restaurants-20k), and Figure 2 provides a snapshot of the data.
using it in the system.
The dataset was collected from user reviews and ratings on the popular restaurant review social media platform, Foursquare.com. Web scraping is the process of automatically extracting data from websites using software tools called web scrapers [36]. This dataset includes various features such as restaurant names, ratings, tips, and locations for restaurants based in Riyadh city, totaling 14,520 unique values. The dataset is publicly available on Kaggle.com (www.kaggle.com/datasets/fahd09/riyadh-restaurants-20k), and Figure 2 provides a snapshot of the data. Each row in the dataset represents a restaurant, and the columns represent features, which are detailed in Table 1. The table provides a description of the features included in the Riyadh restaurants dataset. The features include the name, categories, address, latitude, longitude, price category, number of likes, number of photos, number of tips, average rating, and the number of raters. Note that the address column is the least useful due to the lack of formal addresses for many restaurants. The columns of interest are highlighted in bold for easy reference.

Feature Name Description Name
The name of the restaurant. Some names are only available in Arabic.

Categories
The list of categories (in English) separated by a comma.

Address
The address according to Foursquare. Unfortunately, it is the least useful column in the dataset because many restaurants lack a formal address. Future versions of this dataset may include an enhanced address format. Lat Latitude. Lng Longitude.

Price
Shows the price category (cheap, moderate, expensive, very expensive). Likes The number of likes. Each row in the dataset represents a restaurant, and the columns represent features, which are detailed in Table 1. The table provides a description of the features included in the Riyadh restaurants dataset. The features include the name, categories, address, latitude, longitude, price category, number of likes, number of photos, number of tips, average rating, and the number of raters. Note that the address column is the least useful due to the lack of formal addresses for many restaurants. The columns of interest are highlighted in bold for easy reference. Table 1. Description of features in the Riyadh restaurants dataset.

Feature Name Description Name
The name of the restaurant. Some names are only available in Arabic.

Categories
The list of categories (in English) separated by a comma.

Address
The address according to Foursquare. Unfortunately, it is the least useful column in the dataset because many restaurants lack a formal address. Future versions of this dataset may include an enhanced address format. Lat Latitude. Lng Longitude. Price Shows the price category (cheap, moderate, expensive, very expensive). Likes The number of likes. Photos The number of photos. Photos themselves are not included.

Tips
The number of tips in Foursquare (e.g., "Don't miss their pasta"). Tips themselves are not included.

Rating
The average rating out of 10.

Rating Signals
The number of raters.
Note: Columns of interest are in bold. Once the data have been collected, it is important to preprocess them to remove noise and inconsistencies and transform them into a format suitable for use by the recommender system. This involves various techniques such as data cleaning, removing duplicates or missing data, converting categorical data into numerical data, normalization, and feature extraction.
In our research, we performed data wrangling to unify the many categories in the dataset, which numbered 1130, into a more reasonable number of 16 categories. Our approach involved grouping each category into its main cuisine, for example, Syrian, Lebanese, and Egyptian cuisines were all grouped into the Mediterranean cuisine category.
We also dealt with missing data in some columns. For the price column, we used the mode of the category that the restaurant fell into, while for the rating column, we used the average rating of restaurants in the same category. These techniques helped to ensure that the data used for the recommender system were as accurate and complete as possible.
The preprocessed data can be used now to train the model to predict users' preferences and recommend restaurants that are likely to be of interest to users.

The Recommender Systems
The present study involved the construction of a content-based recommender system and three matrix factorization models, namely, singular value decomposition (SVD), optimized singular value decomposition (SVD++), and non-negative matrix factorization (NMF), for the purpose of predicting restaurant ratings and generating personalized recommendations for users. The main objective of this experiment was to assess the performance of these algorithms by utilizing two performance metrics, namely root mean square error (RMSE) and mean absolute error (MAE). Through the evaluation of these metrics, the study aims to provide valuable insights into the effectiveness of the recommender systems and their potential practical implications in the dining industry.

Content-Based Model
The methodology for the first recommender system, which is content-based filtering, involved several steps. Initially, we collected the user's ratings for a set of restaurants. We then created the user profile, which represented the features that were present in the user's rating list. The next step was to create a feature matrix that contained the features of interest for each restaurant such as prices and categories. This feature matrix was obtained from the dataset. The matrix has restaurants listed in the rows and features listed in the columns. Each cell in the matrix represents a feature value for a particular restaurant. For example, a cell in the "price" column for a particular restaurant contains the price category (e.g., cheap, moderate, expensive, very expensive) for that restaurant. Similarly, a cell in the "category" column for a particular restaurant contains the category to which the restaurant belongs (e.g., Mediterranean, Italian, Japanese). We represented this as a Boolean matrix.
To facilitate the explanation, we employ the sample scenario depicted in Figure 3a, where R 1-4 denote restaurants and U 1-3 denote users. The cells that do not have a rating are represented with a dash. In addition, Figure 3b presents features that describe each restaurant's characteristics. More specifically, the matrix R(u,r) represents the ratings that user u has given to each restaurant r. To represent the presence or absence of a particular feature in a restaurant, we utilize a Boolean matrix F, where the element F(r,f ) is equal to one if restaurant r has feature f, and zero otherwise. To construct a profile for a user u, we create a matrix P(u,f ) where the elements are defined as follows: Therefore, P(u,f ) denotes the correlation between user u and feature f. feature in a restaurant, we utilize a Boolean matrix F, where the element F(r,f) is equal to one if restaurant r has feature f, and zero otherwise. To construct a profile for a user u, we create a matrix P(u,f) where the elements are defined as follows: Therefore, P(u,f) denotes the correlation between user u and feature f. After creating the feature matrix, the user profile is multiplied with the feature matrix to obtain the weighted matrix. The weighted matrix represents the similarity between the user's preferences and the features of each restaurant. The weighted matrix is then sorted in descending order based on the similarity values, and the top 10 recommendations are presented to the user. Figure 4 depicts an example of the user input and system recommendations.

Matrix Factorization Model
The goal of collaborative filtering is to predict a user's interests or rating by collecting preference information from other users. Matrix factorization is a popular technique used in collaborative-based filtering, which characterizes items and users through vectors of factors inferred from the item rating patterns [16]. The concept behind matrix factorization is straightforward. It involves decomposing the user-restaurant rating matrix into two After creating the feature matrix, the user profile is multiplied with the feature matrix to obtain the weighted matrix. The weighted matrix represents the similarity between the user's preferences and the features of each restaurant. The weighted matrix is then sorted in descending order based on the similarity values, and the top 10 recommendations are presented to the user. Figure 4 depicts an example of the user input and system recommendations.
one if restaurant r has feature f, and zero otherwise. To construct a profile for a user u, we create a matrix P(u,f) where the elements are defined as follows: Therefore, P(u,f) denotes the correlation between user u and feature f. After creating the feature matrix, the user profile is multiplied with the feature matrix to obtain the weighted matrix. The weighted matrix represents the similarity between the user's preferences and the features of each restaurant. The weighted matrix is then sorted in descending order based on the similarity values, and the top 10 recommendations are presented to the user. Figure 4 depicts an example of the user input and system recommendations.

Matrix Factorization Model
The goal of collaborative filtering is to predict a user's interests or rating by collecting preference information from other users. Matrix factorization is a popular technique used in collaborative-based filtering, which characterizes items and users through vectors of factors inferred from the item rating patterns [16]. The concept behind matrix factorization is straightforward. It involves decomposing the user-restaurant rating matrix into two

Matrix Factorization Model
The goal of collaborative filtering is to predict a user's interests or rating by collecting preference information from other users. Matrix factorization is a popular technique used in collaborative-based filtering, which characterizes items and users through vectors of factors inferred from the item rating patterns [16]. The concept behind matrix factorization is straightforward. It involves decomposing the user-restaurant rating matrix into two lower-dimensional matrices: a user factor matrix and a restaurant factor matrix. The user factor matrix represents the preferences of each user, while the restaurant factor matrix represents the features of each restaurant. By multiplying the two matrices together, the rating that a user would give to a restaurant that they have not yet rated is predicted.
In this paper, we implemented a collaborative-based recommender system using three matrix factorization-based algorithms. Particularly, we implemented and contrasted three algorithms: non-negative matrix factorization (NMF) [18], singular value decomposition (SVD) [20], and optimized singular value decomposition (SVD++) [16]. NMF decomposes the original matrix into two smaller non-negative matrices [18]. SVD is a widely used algorithm for solving real and complex metrics, as well as for rate estimation and canonical correlation analysis. SVD++ [19] is an advanced version of the SVD model that takes into account implicit feedback. Implicit feedback includes information on the user's preference history, which provides details on the items for which the user has expressed a preference, either explicitly or implicitly.
Since the Riyadh restaurants dataset did not include user information, we added a new column called "user_id" and filled it with random numbers to enable personalized recommendations for each user. We selected three recommendation parameters from the datasets: user id, restaurant id, and rating. The three recommendation models were implemented using the Surprise Python library [37], an open-source tool that provides implementation for various recommendation algorithms. After implementing each model, we used the predict (user_id, item_id) method to see the rating prediction given by a model for a single user and item. Figure 5A shows the actual rating for a restaurant id (433) and user id (13,627), while Figure 5B shows the estimated rate according to each model for this restaurant. The NMF model showed the best estimation, with a rating value of 3.7, which was closest to the actual rating value of 4.8.
three matrix factorization-based algorithms. Particularly, we implemented and contrasted three algorithms: non-negative matrix factorization (NMF) [18], singular value decomposition (SVD) [20], and optimized singular value decomposition (SVD++) [16]. NMF decomposes the original matrix into two smaller non-negative matrices [18]. SVD is a widely used algorithm for solving real and complex metrics, as well as for rate estimation and canonical correlation analysis. SVD++ [19] is an advanced version of the SVD model that takes into account implicit feedback. Implicit feedback includes information on the user's preference history, which provides details on the items for which the user has expressed a preference, either explicitly or implicitly.
Since the Riyadh restaurants dataset did not include user information, we added a new column called "user_id" and filled it with random numbers to enable personalized recommendations for each user. We selected three recommendation parameters from the datasets: user id, restaurant id, and rating. The three recommendation models were implemented using the Surprise Python library [37], an open-source tool that provides implementation for various recommendation algorithms. After implementing each model, we used the predict (user_id, item_id) method to see the rating prediction given by a model for a single user and item. Figure 5A shows the actual rating for a restaurant id (433) and user id (13,627), while Figure 5B shows the estimated rate according to each model for this restaurant. The NMF model showed the best estimation, with a rating value of 3.7, which was closest to the actual rating value of 4.8.

Content-Based Model
As compared to other regression and classification algorithms, content-based methods do not have a direct method for evaluating the feasibility of recommendations using well-known metrics such as RMSE, MAE, Recall, and Precision. As a result, the

Content-Based Model
As compared to other regression and classification algorithms, content-based methods do not have a direct method for evaluating the feasibility of recommendations using wellknown metrics such as RMSE, MAE, Recall, and Precision. As a result, the evaluation of this model must be completed with the help of the user, which is not always reliable as it is based on personal preferences rather than objective facts. To evaluate the content-based recommender system, we created a custom metric to assess the recommendations' quality. We have used the test set to evaluate the system. We hid 40% of the user's data from the system to use them as testing data. Then, we derived the recommendations from the remaining 60% and selected the top 30 recommended restaurants. We then searched for the presence of the 40% of restaurants among the top 30 recommended restaurants and calculated the ratio of the present restaurants among the 30 recommended restaurants. This metric is shown in Figure 6.
of the user's data from the system to use them as testing data. Then, we derived the recommendations from the remaining 60% and selected the top 30 recommended restaurants. We then searched for the presence of the 40% of restaurants among the top 30 recommended restaurants and calculated the ratio of the present restaurants among the 30 recommended restaurants. This metric is shown in Figure 6.
We attempted to calculate metrics such as RMSE, MAE, Precision, and Recall, but since the resulting predicted data are not numerical (they are the names of the restaurants that might suit the user's preferences), it is not possible to calculate the difference between the predicted and real values. Additionally, users may input their preferences without considering the order of their most preferred restaurants, which makes the calculation of these metrics unviable as the most preferred restaurant by the user may not necessarily be the top recommendation in the list of recommended restaurants.

Matrix Factorization Model
The performance of NMF, SVD, and SVD++ has been evaluated in 5-fold crossvalidations using two commonly used metrics, namely root mean squared error (RMSE) and mean absolute error (MAE).

−
The RMSE calculates the square root of the average square differences between the predicted (si,j) and actual ratings (ri,j) (Equation (2). The RMSE provides a measure of the accuracy of the predicted ratings, with lower values indicating better performance [38].
− The MAE calculates the average absolute difference between the predicted (yi) and actual ratings (xi) (Equation (3)). The MAE provides a measure of the overall deviation of the predicted ratings from the actual ratings, with lower values indicating better performance.

∑ | |
(3) Table 2 shows the performance comparison of NMF, SVD, and SVD++ in 5-fold crossvalidations using the RMSE and MAE. We attempted to calculate metrics such as RMSE, MAE, Precision, and Recall, but since the resulting predicted data are not numerical (they are the names of the restaurants that might suit the user's preferences), it is not possible to calculate the difference between the predicted and real values. Additionally, users may input their preferences without considering the order of their most preferred restaurants, which makes the calculation of these metrics unviable as the most preferred restaurant by the user may not necessarily be the top recommendation in the list of recommended restaurants.

Matrix Factorization Model
The performance of NMF, SVD, and SVD++ has been evaluated in 5-fold crossvalidations using two commonly used metrics, namely root mean squared error (RMSE) and mean absolute error (MAE).

-
The RMSE calculates the square root of the average square differences between the predicted (s i,j ) and actual ratings (r i,j ) (Equation (2). The RMSE provides a measure of the accuracy of the predicted ratings, with lower values indicating better performance [38].
The MAE calculates the average absolute difference between the predicted (y i ) and actual ratings (x i ) (Equation (3)). The MAE provides a measure of the overall deviation of the predicted ratings from the actual ratings, with lower values indicating better performance. Table 2 shows the performance comparison of NMF, SVD, and SVD++ in 5-fold crossvalidations using the RMSE and MAE. Based on these results, we can conclude that SVD performs the best in terms of RMSE, while NMF performs the best in terms of MAE. However, the differences in performance between the three methods are relatively small, suggesting that the choice of method may depend on the specific recommendation task and the trade-offs between accuracy and computational efficiency.

Performance Comparison of Matrix Factorization and Popularity-Based Models
The popularity-based recommender system simply recommends the most popular items to all users, without taking into account the specific preferences or past behavior of individual users. We chose to evaluate the popularity-based recommender system using the MAE metric, which measures the average absolute difference between the actual and predicted ratings. This allows us to compare the accuracy of the popularity-based recommender system to that of the collaborative filtering methods, which do make individualized predictions. Table 3 includes the average RMSE and MAE values for each method, based on the values provided. It also includes a popularity-based recommender system for comparison. We can see that SVD has the lowest average RMSE of 0.6439, followed closely by SVD++ with an average RMSE of 0.6462. NMF has the highest average RMSE of 0.6478. Additionally, we can see that the differences in RMSE values between the methods are relatively small.
For the MAE metric, we can see that NMF has the lowest average MAE of 0.455, followed closely by SVD with an average MAE of 0.460. SVD++ has the highest average MAE of 0.462. The popularity-based recommender system has an average MAE of 0.475, which is higher than all three collaborative filtering methods.
The reason why there is no value for popularity-based RMSE in the table is that the popularity-based recommender system does not predict ratings for individual users or items, and therefore cannot be evaluated using RMSE.
These results suggest that both SVD and NMF are effective methods for generating accurate recommendations, with SVD performing slightly better in terms of RMSE and NMF performing slightly better in terms of MAE. SVD++ is also a viable option, but has slightly higher RMSE and MAE values than SVD and NMF. The popularity-based recommender system, on the other hand, is not as effective in generating accurate recommendations, as reflected by its higher MAE value.
It is important to note that these results are based on a specific dataset, and the performance of the methods may vary with different datasets. Therefore, it is important to conduct further experiments and evaluations of different datasets to confirm these results and to choose the most appropriate method for a given recommendation task.

Deployment
After developing and evaluating the system, we deployed it for use by users. This involved integrating the system into a website that users can browse to find recommendations.

Content-Based Recommender System
The content-based recommender system was developed using Python, with libraries Pandas, NumPy, and RegEx utilized for data cleaning and manipulation. The system uses weighted matrices to generate a list of similar restaurants based on the user's profile features. For the user interface, PHP was used to create a home screen that directs the user to the desired recommender system, as shown in Figure 7.
which is higher than all three collaborative filtering methods.
The reason why there is no value for popularity-based RMSE in the table is that the popularity-based recommender system does not predict ratings for individual users or items, and therefore cannot be evaluated using RMSE.
These results suggest that both SVD and NMF are effective methods for generating accurate recommendations, with SVD performing slightly better in terms of RMSE and NMF performing slightly better in terms of MAE. SVD++ is also a viable option, but has slightly higher RMSE and MAE values than SVD and NMF. The popularity-based recommender system, on the other hand, is not as effective in generating accurate recommendations, as reflected by its higher MAE value.
It is important to note that these results are based on a specific dataset, and the performance of the methods may vary with different datasets. Therefore, it is important to conduct further experiments and evaluations of different datasets to confirm these results and to choose the most appropriate method for a given recommendation task.

Deployment
After developing and evaluating the system, we deployed it for use by users. This involved integrating the system into a website that users can browse to find recommendations.

Content-Based Recommender System
The content-based recommender system was developed using Python, with libraries Pandas, NumPy, and RegEx utilized for data cleaning and manipulation. The system uses weighted matrices to generate a list of similar restaurants based on the user's profile features. For the user interface, PHP was used to create a home screen that directs the user to the desired recommender system, as shown in Figure 7. Upon clicking the content-based button, the user is directed to the web page shown in Figure 8, where they can enter as many input entries as desired and then press the submit button. Upon clicking the content-based button, the user is directed to the web page shown in Figure 8, where they can enter as many input entries as desired and then press the submit button.
After submitting the entries, the user can view the results by clicking on the "show results" button, as shown in Figure 9. The web page displays the recommended restaurants based on the user's input and provides information such as the restaurant's name and address. After submitting the entries, the user can view the results by clicking on the "show results" button, as shown in Figure 9. The web page displays the recommended restaurants based on the user's input and provides information such as the restaurant's name and address.

Matrix Factorization Recommender System
For the collaborative-based recommender system, we employed only two matrix factorization algorithms, namely NMF and SVD. Figure 10a,b display the user interface for the collaborative-based filtering system, which includes a login page and home page  After submitting the entries, the user can view the results by clicking on the "show results" button, as shown in Figure 9. The web page displays the recommended restaurants based on the user's input and provides information such as the restaurant's name and address.

Matrix Factorization Recommender System
For the collaborative-based recommender system, we employed only two matrix factorization algorithms, namely NMF and SVD. Figure 10a,b display the user interface for the collaborative-based filtering system, which includes a login page and home page

Matrix Factorization Recommender System
For the collaborative-based recommender system, we employed only two matrix factorization algorithms, namely NMF and SVD. Figure 10a,b display the user interface for the collaborative-based filtering system, which includes a login page and home page with three buttons: content-based, collaborative-based NMF, and collaborative-based SVD.   When the user clicks on the collaborative-based NMF button, they are redirected to the "nmf.php" page, as shown in Figure 10c, where they can enter the restaurant name and their rating. Once the user has entered one or more restaurants and clicked the "submit" button, the PHP code saves the user entries as a CSV file that includes user ID, restaurant name, and rating. The Python script "nmf_processing.py" then matches the restaurant names with their IDs, processes the user's recommendations, and appends the user data to the whole dataset, as shown in Figure 11.

Discussion
The evaluation and analysis of the content-based and matrix factorization recommender systems provide insights into their performance and effectiveness in generating recommendations.
The content-based method presents a limitation in its evaluation, as it does not have a direct method for evaluating the feasibility of recommendations using well-known metrics such as RMSE and MAE. This limitation requires the evaluation of the model with the help of the user, which can be biased because it is based on personal preferences rather than objective facts. To address this limitation, the evaluation of the content-based recommender system in the current study employed a custom metric. This metric assessed the recommendations' quality by calculating the ratio of the present restaurants among the 30 recommended restaurants. While this approach provides a means of evaluating the content-based method, it is important to consider its limitations due to the reliance on subjective user preferences.
On the other hand, the performance of NMF, SVD, and SVD++ has been evaluated in five-fold cross-validations using two standard metrics, RMSE and MAE. The evaluation results demonstrate the effectiveness of SVD in generating accurate recommendations in the context of the current study. However, it is important to note that the performance of collaborative filtering methods may vary depending on the characteristics of the dataset and the specific recommendation problem. Therefore, it is recommended to conduct a thorough evaluation and comparison of different algorithms before selecting the most appropriate method.
We also compared the performance of our system with the popularity-based recommender system. Our system performed slightly better in terms of accuracy compared to the popularity-based recommender system. The improved performance of our system can be attributed to the collaborative filtering approach, which is able to capture the complex relationships between users and items. The matrix factorization algorithm is able to effectively handle the large and sparse dataset, resulting in more Based on the user's entries and the training set, the NMF method generates recommendations for the user and stores them in a text file. The PHP file "nmf_results.php" then prints the recommendation results for the user, as shown in Figure 12. The SVD algorithm follows the same steps as the NMF method.

Discussion
The evaluation and analysis of the content-based and matrix factorization recommender systems provide insights into their performance and effectiveness in generating recommendations.
The content-based method presents a limitation in its evaluation, as it does not have a direct method for evaluating the feasibility of recommendations using well-known metrics such as RMSE and MAE. This limitation requires the evaluation of the model with the help of the user, which can be biased because it is based on personal preferences rather than objective facts. To address this limitation, the evaluation of the content-based recommender system in the current study employed a custom metric. This metric assessed the recommendations' quality by calculating the ratio of the present restaurants among the 30 recommended restaurants. While this approach provides a means of evaluating the content-based method, it is important to consider its limitations due to the reliance on subjective user preferences.
On the other hand, the performance of NMF, SVD, and SVD++ has been evaluated in five-fold cross-validations using two standard metrics, RMSE and MAE. The evaluation results demonstrate the effectiveness of SVD in generating accurate recommendations in the context of the current study. However, it is important to note that the performance of collaborative filtering methods may vary depending on the characteristics of the dataset and the specific recommendation problem. Therefore, it is recommended to conduct a thorough evaluation and comparison of different algorithms before selecting the most appropriate method.
We also compared the performance of our system with the popularity-based recommender system. Our system performed slightly better in terms of accuracy compared to the popularity-based recommender system. The improved performance of our system can be attributed to the collaborative filtering approach, which is able to capture the complex relationships between users and items. The matrix factorization algorithm is able to effectively handle the large and sparse dataset, resulting in more Overall, the collaborative-based recommender system provides a user-friendly interface for generating personalized recommendations based on user preferences. The system integrates seamlessly with PHP and Python, allowing for efficient data processing and recommendation generation.

Discussion
The evaluation and analysis of the content-based and matrix factorization recommender systems provide insights into their performance and effectiveness in generating recommendations.
The content-based method presents a limitation in its evaluation, as it does not have a direct method for evaluating the feasibility of recommendations using well-known metrics such as RMSE and MAE. This limitation requires the evaluation of the model with the help of the user, which can be biased because it is based on personal preferences rather than objective facts. To address this limitation, the evaluation of the content-based recommender system in the current study employed a custom metric. This metric assessed the recommendations' quality by calculating the ratio of the present restaurants among the 30 recommended restaurants. While this approach provides a means of evaluating the content-based method, it is important to consider its limitations due to the reliance on subjective user preferences.
On the other hand, the performance of NMF, SVD, and SVD++ has been evaluated in five-fold cross-validations using two standard metrics, RMSE and MAE. The evaluation results demonstrate the effectiveness of SVD in generating accurate recommendations in the context of the current study. However, it is important to note that the performance of collaborative filtering methods may vary depending on the characteristics of the dataset and the specific recommendation problem. Therefore, it is recommended to conduct a thorough evaluation and comparison of different algorithms before selecting the most appropriate method.
We also compared the performance of our system with the popularity-based recommender system. Our system performed slightly better in terms of accuracy compared to the popularity-based recommender system. The improved performance of our system can be attributed to the collaborative filtering approach, which is able to capture the complex relationships between users and items. The matrix factorization algorithm is able to effectively handle the large and sparse dataset, resulting in more accurate and relevant recommendations. Moreover, the system can be adapted to different types of restaurants and cuisines, making it applicable to a wide range of users. This is in line with the fact that personalized recommender systems have widely used the matrix factorization model due to its high accuracy and scalability, as noted in [16,39].
The deployment of the content-based and collaborative-based recommender systems in the web application provides a user-friendly interface for generating personalized recommendations based on user preferences. However, the development of the recommender systems presented several challenges, including working with multiple scripting/programming/markup languages and conflicts with Python libraries when working in the localhost and Apache server.
To overcome these issues, the development team relied on adding user entries through PHP into an entries log file (content_based.csv). Then, Python read and processed these entries to generate the resulting recommended restaurants in an external text file (con-tent_result.txt), which the system grabbed using PHP, read its values, and reflected them into HTML using JavaScript to manipulate the document object model (DOM) elements of the HTML structure. Furthermore, the team found it easier to work with a virtual environment, such as Jupyter and Google CoLab, to overcome conflicts with Python libraries. One limitation of our system is the reliance on user reviews and ratings, which may not always reflect the true preferences of users.
Despite these challenges, the deployment of the recommender systems has practical implications for restaurant owners and users in Riyadh city. The content-based system can provide personalized recommendations to users based on their preferences, improving their dining experiences and increasing customer satisfaction. On the other hand, the collaborative-based system can help restaurant owners identify customer preferences and tailor their offerings to meet those preferences, leading to increased sales and customer loyalty. Furthermore, the deployment of the recommender systems in a web application provides a platform for users to access the recommendations conveniently. The userfriendly interface of the web application ensures that users can easily navigate through the system and get their desired recommendations. This can help increase user engagement with the system and improve the overall user experience. The proposed recommender system demonstrates the potential of intelligent systems for real-world applications in the field of data science and knowledge engineering. The system leverages machine learning techniques, such as collaborative filtering and matrix factorization, to generate accurate and personalized recommendations for users based on their preferences. Additionally, the system incorporates a comprehensive dataset of restaurant features and attributes, providing a valuable resource for researchers and practitioners working in the field of intelligent systems and data science.
To extend the proposed system, future research could explore the integration of additional features, such as location-based recommendations, social media activity, or real-time updates on restaurant availability and wait times. Additionally, the system could incorporate user feedback and ratings to continuously improve the accuracy and relevance of recommendations. This could enhance the user experience and increase user engagement, as in [26,[40][41][42][43][44], where item attributes and social networks were integrated into the model to improve recommendation performance. In addition, research can explore the potential of the system to be applied in other cities or countries with similar restaurant industries. This may involve fine-tuning the model to account for cultural and demographic differences. Overall, the proposed system demonstrates the potential of intelligent systems to enhance user experiences and meet the challenges and opportunities in the field of knowledge engineering and data science.

Conclusions
In this paper, we created a publicly available dataset of Riyadh restaurants and developed multiple recommender systems using this dataset. These systems included a content-based recommender system and three collaborative-based filtering systems based on matrix factorization techniques (NMF, SVD, and SVD++). To evaluate the performance of these methods, we used RMSE and MAE as evaluation metrics and compared our results to a popularity-based recommender system.
Our evaluation results showed that SVD and NMF are effective methods for generating recommendations, with SVD performing slightly better in terms of RMSE and NMF performing slightly better in terms of MAE. While SVD++ is also a viable option, it has slightly higher RMSE and MAE values than SVD and NMF.
Overall, our findings suggest that the collaborative-based approach using matrix factorization algorithms is an effective way to capture the complex relationships between users and restaurants. By leveraging user reviews and ratings, the system can recommend relevant restaurants to users, ultimately improving the dining experience for customers and increasing revenue for restaurants.