Page cover image

User-User Collaborative Filtering

Consider the following ratings matrix. As the usual convention, each row represents a user and each column represents a movie.

Batman
X-Men
Star Wars
Notebook
Titanic

Alice

5

4.5

5

2

1

Bob

4.5

4

2

2

Carol

2

3

1

5

5

Intutively, we see that Bob's ratings are similar to Alice's, thus he is likely to also like Star Wars.

"Math-Speak", Alice's and Bob's ratings are highly correlated.

Average Rating

Using average ratings has its limitations. It treats everyone's rating of the movie equally. For example, when using the average rating methodolgy, Bob's rating equally depends on Alice's and Carol's rating, even though he doesn't agree with Carol.

Following is the equation for average rating:

s(i,j)=∑i‘∈Ωjri‘j∣Ωj∣where,Ωj≡Setofalluserswhohaveratedmoviej.s(i,j) = \frac{\sum_{i^` \isin \Omega_j} r_{i^`j}}{|\Omega_j|} \\ where, \Omega_j \equiv Set \hspace{0.1cm} of \hspace{0.1cm} all \hspace{0.1cm} users \hspace{0.1cm} who \hspace{0.1cm} have \hspace{0.1cm} rated \hspace{0.1cm} movie \hspace{0.1cm} j.

Weighted Rating

Weighted rating overcomes the limitation of average rating as it takes into account weightage of each rating. Following is the equation to calculate weighted rating of movie jj​ by user ii.

Deviation

In recommender systems, rather than caring about absolute ratings, we care how much it deviates from a user's own average rating.

For example, if a user's average rating is 2.5, and the user rates a particular movie as a 5, it must be really good.

For a known rating jj​ by user ii​, deviation is given by the following equation:

dev(i,j)=r(i,j)−riˉwhere,r(i,j)≡Knownratingbyuseriformoviej.riˉ≡Averageratingbyuseribasedonallthemoviess(he)hasrated.dev(i,j) = r(i,j) - \={r_i} \\ where, r(i,j) \equiv Known \hspace{0.1cm} rating \hspace{0.1cm} by \hspace{0.1cm} user \hspace{0.1cm} i \hspace{0.1cm} for \hspace{0.1cm} movie \hspace{0.1cm} j. \\ \={r_i} \equiv Average \hspace{0.1cm} rating \hspace{0.1cm} by \hspace{0.1cm} user \hspace{0.1cm} i \hspace{0.1cm} based \hspace{0.1cm} on \hspace{0.1cm} all \hspace{0.1cm} the \hspace{0.1cm} movies \hspace{0.1cm} s(he) \hspace{0.1cm} has \hspace{0.1cm} rated.

​

Last updated