## 4 Proposed Model
### User-Based Similarity Measure Using Item Genre Information  
This section includes a user-based similarity measure model, defined from user preferences for item genres. In this model, the classifications of users were prepared according to their preferences for item genres. Then, the similarity between users was determined according to the average user rating for the item genres, thus it was named the user-genre similarity model (UGSM), and is shown in Figure 3.  
As a result of classifying users according to their favorite item genres, we constructed Table 1, showing a representative sample of five users and their preferred genres. Assuming that \(U=\{u1,u2\dots\ un\}\) represents the set of users, and \(G=\{g1,g2\dots\ gs\}\) represents the collection of genres, and \(I=\{p1,p2\dots\ pm\}\) is a set of common items, the item genres in Table 1 refer to the movie genres identified in the movie lens dataset [26], and the values represent the average user ratings for their preferred genres. Figure 2: Current recommendation algorithms and categories. From Table 1, it is clear that an item may be related to multiple genres and that user preferences differ from one genre to another. Selecting an active user (_a_) of a particular genre means the user prefers that genre. Therefore, there are remarkable opportunities for two users to be highly similar when they like the same genre. The essence of memory-based CF algorithms is calculating the actual similarity between entities to select proper neighbors. Thus, in addition to the rating prediction phase, the proposed similarity measure involves four significant steps:  
* Step 1: Building a genre rating <_u_ \(\times\)_g_> matrix from the master dataset, including (_u-id_, _i-id_, \(r\), _i-g_) by calculating the user preference average per item genre (_g_). * Step 2: Finding the similarity between the users' preferences per genre using Equation (2). A slight difference indicates a significant similarity. \[diff(a,u_{i})=\mid avr\;r_{a,gj}-avr\;r_{u,gj}\;\mid\Leftrightarrow a\;,\;\text {and}\;ui\;preferred\;g_{j}\] (2) \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**g Name** & **u1** & **u2** & **u3** & **u4** & **u5** \\ \hline g1: Action \(\mid\)Comedy \(\mid\)Sci-Fi \(\mid\)Thriller & 4 & 5 & 3 & 5 & 3 \\ g2: Action \(\mid\)Thriller & 3 & 5 & 0 & 3 & 3 \\ g3: Adventurel \(\mid\)Animation \(\mid\)Children & 0 & 4 & 0 & 4 & 3 \\ g4: Comedy & 3.5 & 4 & 5 & 3 & 5 \\ g5: Adventure & 5 & 0 & 3.5 & 4 & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Users (u) and their mean rating on preferred item genres (g). Figure 3: Proposed model flowchart. where \(i\) = 1..., n, and \(j\) = 1..., s.\(diff(a,u_{i})\) represents the degree of difference between \(a\) and \(u\) preferences for the same genre, \(g\). A smaller value means more significant similarity between users. \(avr\)\(r_{a,gj}\) represents the average ratings of \(a\) to \(g_{j}\). \(avr\)\(r_{ui,gj}\) represents the average ratings of \(ui\) to \(g_{j}\). * User' similarity is calculated as the absolute difference between user rating average for the same genre. * Step 3: Finding the nearest neighbors (K-NN) for each user per genre by arranging the difference values in the preferences rate in ascending order. * Step 4: Finding the final nearest neighbors (_NNf_) for the active user by intersecting the groups of K-NN in the previous step to get the neighbors who share all their preferences with the active user, according to Equation (3). \[a_{NNf}=a_{kNN,g1}\ \cap\ \ a_{kNN,gj}\] (3) where \(a_{NNf}\) is the final \(a\)'s _NN_. \(a_{kNN,g1}\) is the K-NN for \(a\) in the first common genre, \(g1\). \(a_{kNN,gj}\) is the K-NN for \(a\) in the jth common genre. As shown in Table 1, if two users are similar to each other in terms of their preferences for a genre, they may differ for different genres. Therefore, the similarity model must carefully choose a similar neighbor to \(a\) in terms of their preferences for genres.