L6 Recommendation
L6 Recommendation
L6 Recommendation
Making Recommendations
Jonathon Hare
jsh2@ecs.soton.ac.uk
Introduction
Collaborative Filtering
If Jack loves A and B, and Jill loves A, B, and C, then Jack is more
likely to love C
Does not rely on item or user attributes (e.g. demographic info, author,
genre)
This lecture
Collecting user preferences
For example:
You, Me
Lady in Snakes on Just My Superman The Night
and
the Water a Plane Luck Returns Listener
Dupree
Lisa 2.5 3.5 3.0 3.5 3.0 2.5
Gene 3.0 3.5 1.5 5.0 3.0 3.5
Michael 2.5 3.0 3.5 4.0
Claudia 3.5 3.0 4.0 4.5 2.5
Mick 3.0 4.0 2.0 3.0 3.0 2.0
Jack 3.0 4.0 5.0 3.0 3.5
Toby 4.5 4.0 1.0
This dataset is sparse. It has missing values!
You, Me
Lady in Snakes on Just My Superman The Night
and
the Water a Plane Luck Returns Listener
Dupree
Lisa 2.5 3.5 3.0 3.5 3.0 2.5
Gene 3.0 3.5 1.5 5.0 3.0 3.5
Michael 2.5 3.0 3.5 4.0
Claudia 3.5 3.0 4.0 4.5 2.5
Mick 3.0 4.0 2.0 3.0 3.0 2.0
Jack 3.0 4.0 5.0 3.0 3.5
Toby 4.5 4.0 1.0
Aside: Sparse data
This sparsity is important
Faster computation
Sparse vectors
Intelligent
Algorithm
Data Mining
INFORMATION
(output)
Key terminology
featurevector: a mathematical vector
Computed via an
extension of Pythagoras
theorem to n
dimensions:
v
u n
uX p
D2 (p, q) = t (pi qi )2 = ||p q|| = (p q) (p q)
i=1
L1 distance (aka
Taxicab/Manhattan)
L1 distance is computed
along paths parallel to the
axes of the space:
n
X
D1 (p, q) = ||p q||1 = |pi qi |
i=1
The Lp distances
Generalisation of the L1
and L2 distances to higher
orders:
n
X 1
Dp (x, y) = ||x y||p = ( |xi yi |) p
i=1
Cosine Similarity
Cosine similarity measures
the cosine of the angle
between two vectors
It is not a distance!
P
n
pi q i
pq
cos() = = s i=1 s
||p||||q|| P
n P n
p2i qi2
i=1 i=1
Can we use this data to measure and rank the similarity of users?
On the basis that similar users have similar tastes (i.e. like
the same movies)
We could choose:
1
simL2 (x, y) = r P
1+ (rx,i ry,i )2
i2Ixy
where rx,i refers to the rating given by user x to item i,
and Ixy is the set of items rated by both user x and y
Pearson Correlation
two users might agree that they both enjoyed a film, but
one might give it a 4 and the other a 5
data standardisation
User-based Filtering: Rating and Ranking the critics
Basic idea:
Weight the scores of each item each similar user has rated
Computationally hard
Steps:
Precompute the most similar items for each item and store them
Bootstrap ratings for the new item for the users that
rated similar items by averaging the ratings those users
gave to similar items
Potential solutions for new users