AStudyof Mathematical Modelfor Collaborative Filtering
AStudyof Mathematical Modelfor Collaborative Filtering
net/publication/366902172
CITATIONS READS
0 980
1 author:
Prakash Upadhyaya
Tribhuvan University
11 PUBLICATIONS 0 CITATIONS
SEE PROFILE
All content following this page was uploaded by Prakash Upadhyaya on 06 January 2023.
Collaborative Filtering
Collaborative Filtering has two senses: a narrow one and a more general one.
The growth of the internet has made it much more difficult to effectively extract
useful information from all the available online information. The overwhelming
amount of data necessitates mechanism for efficient information filtering.
Collaborative filtering is one of the techniques used for dealing with this problem.
#Example:
A database of ratings of the current user “PAKKU”, and other users is given:
Users Item 1 Item 2 Item 3 Item 4 Item 5
PAKKU 5 3 4 4 ?
U1 3 1 2 3 3
U2 4 3 4 3 4
U3 3 3 1 5 4
U4 1 5 5 2 1
- Determine whether PAKKU will like or dislike Item 5, which PAKKU has not yet
seen or rated.
𝑎, 𝑏 ∶ 𝑢𝑠𝑒𝑟𝑠
𝑟𝑎,𝑝 ∶ rating of user 𝑎 for item p
𝑃 ∶ set of items rated by both 𝑎 and b
Step 1: Calculating the similarity between PAKKU and all the user excluding Item
5 as it is not rated by PAKKU
∑𝑝 𝑟𝑖,𝑝
We calculate average as: 𝑟̅𝑖 = ∑𝑝
Therefore, we have
𝑟̅𝑃𝐴𝐾𝐾𝑈 = 4
𝑟̅𝑈1 = 2.25
𝑟̅𝑈2 = 3.5
𝑟̅𝑈3 = 3
𝑟̅𝑈4 = 3.25
And, calculating new rating (i.e., variance) as
𝑟̅𝑖𝑝 = 𝑟𝑖𝑝 − 𝑟̅𝑖
Which helps to obtain following matrix:
Now, we calculate similarity between PAKKU and all the other users:
(1 × 0.75) + (1 × 1.25) + (0 × −0.25) + (0 × 0.75)
𝑠𝑖𝑚(𝑃𝐴𝐾𝐾𝑈, 𝑈1) = = 0.85
√12 + 12 + 02 + 02 √0.752 + 1.252 + 0.252 + 0.752
(1 × 0) + (−1 × 0) + (0 × −2) + (0 × 2)
𝑠𝑖𝑚(𝑃𝐴𝐾𝐾𝑈, 𝑈3) = =0
√12 + 12 + 02 + 02 √02 + 02 + 22 + 22
= 4.73
Hence, with the obtained new rating (4.73 ~ 5), we can conclude that Item 5 could
be liked by current user PAKKU.
#Example:
Users Item 1 Item 2 Item 3 Item 4
U1 ? 1 2 3
U2 4 3 4 ?
U3 3 3 ? 5
U4 1 5 5 2
Determine the missing ratings in the table:
The very first step is to build the model by finding similarity between all the item
pairs. The similarity between item pairs can be found using the Cosine Similarity.