## 3 Materials and Methods
### The Recommender Systems
#### 3.2.2 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  
Figure 4: Example of user’s ratings, and system recommendations for a content-based filtering method. The figure shows a table listing the user’s ratings for a set of restaurants (**A**), along with the top 10 recommendations generated by the system based on the user’s preferences (**B**). The recommendations are sorted in descending order based on their predicted score, with the highest-scoring recommendation listed at the top.  
Figure 3: (**a**) User–Restaurant matrix R, (**b**) Boolean Restaurant–Feature matrix F, (**c**) User–Feature matrix P.  
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.