# Cognitive Similarity-Based Collaborative Filtering Recommendation System
## 3 Cognitive Similarity
### Measuring Cognitive Similarity  
The most important step in memory-based collaborative filtering algorithms is calculating the similarity between items or users. The basic idea of calculating the similarity between two items \(item_{i}\) and \(item_{j}\) is to first isolate the user who evaluated both of these items and then apply the same calculation technique to determine the similarity \(Sim\left(item_{i},item_{j}\right)\). In this study, we using soft cosine similarity is the metric for measure the similarity. The cosine similarity is defined to equal the cosine of the angle between two non-zero vectors of an inner product space. Given the vector \(I\) and vector \(J\), the cosine similarity is represented as follows:  
\[CosineSim(I,J)=\frac{I\cdot J}{\|I\|\|J\|}=\frac{\sum_{h=1}^{n}I_{h}J_{h}}{ \sqrt{\sum_{h=1}^{n}I_{h}^{2}}\sqrt{\sum_{h=1}^{n}I_{h}^{2}}}, \tag{4}\]  
where \(I_{h}\) and \(J_{h}\) are components of vector \(I\) and vector \(J\) respectively. For example, given movie \(m_{i}\) which users have seen and all movies \(m_{j}\) remained in the database, we measure similarity \(Sim\left(m_{i},m_{j}\right)\) by using _Vector Cosine-Based Similarity_. Movie \(m\) represented as a vector \(\left\langle T,G,D,A,P\right\rangle\), in which \(T,G,D\), \(A\) and \(P\) represent the feature of title; genre; director; actors; plot. In this regard, the formula for scoring \(Sim\left(m_{i},m_{j}\right)\) described as follows:  
\[Sim\left(m_{i},m_{j}\right)\equiv\left\langle T_{ij},G_{ij},D_{ij},A_{ij},P_{ ij}\right\rangle, \tag{5}\]  
where \(T_{ij},G_{ij},D_{ij},A_{ij}\), and \(P_{ij}\) represent the features which measure similarity between movie \(m_{i}\) and movie \(m_{j}\) such as titles, genres, directors, actors and plots. In particular, consider the title feature, by apply Equation (4), the similarity between the title of movie \(m_{i}\) and movie \(m_{j}\) describe as follows: \begin{table}
\begin{tabular}{l c c c} \hline \hline  & **User-Based CF Approach** & \multicolumn{2}{c}{**Cognitive Similarity Approach**} \\ \cline{2-4}  & **User Similarity** & **Extracted Features** & **User Similarity** \\ \hline [PERSON] & \(\approx\)0.689 & 0.41, 0.60, 0.48, 0.44, 0.46 & \(<\)G, D, P, A, T\(>\) \\ \hline [PERSON] & \(\approx\)0.579 & 0.39, 0.58, 0.49, 0.41, 0.47 & \(<\)G, D, P, A, T\(>\) \\ \hline [PERSON] & \(\approx\)0.468 & 0.43, 0.64, 0.45, 0.49, 0.38 & \(<\)G, A, D, T, P\(>\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison between tradition CF with the user-based approach and our proposed method in considering the relation of users _[PERSON]_, _[PERSON]_ and _[PERSON]_.  
\[T_{ij}=\frac{\sum_{h=1}^{n}T_{i,h}T_{j,h}}{\sqrt{\sum_{h=1}^{n}T_{i,h} {}^{2}}\sqrt{\sum_{h=1}^{n}T_{j,h}{}^{2}}}, \tag{6}\]  
Respectively, we measured the remainder similarity between features such as genre (\(G_{ij}\)), director (\(D_{ij}\)), actors (\(A_{ij}\)), and plot (\(P_{ij}\)). Finally, we repeat that calculation for all the remaining movies in the system and obtain a set \(\{Sim\left(m_{i},m_{j+h}\right)|h\in[1,..,n]\}\). Besides, we add an element that is the priority of users while they select a similar movie. Hence, the Equation (5) is re-written as follows. \[Sim\left(m_{i},m_{j}\right)=\frac{\sum_{k=1}^{n}\omega_{k}\times Sim_{k}\left( m_{i},m_{j}\right)}{\sum_{k=1}^{n}\omega_{k}}, \tag{7}\]  
where \(\omega_{k}\) denote the priority of user in selecting a pair of movies similar; \(k\) denote the number of features extracted from movie \(m\) respectively is the title, genre, director, actor, and plot; \(Sim_{k}\left(m_{i},m_{j}\right)\) is a similarity measuring between movie \(m_{i}\) and movie \(m_{j}\) as described in Equation (5). The priority of users in selecting a pair of movies similarity dynamic re-calculated and updated by the OMS system when users have a new activity (a new pair of movies similarity).