Algorithm Search⌘K

Definitionintro

User-item rating matrix

Also called utility matrix, user-item matrix.

A sparse matrix with a row per user and a column per item, holding known ratings or interactions and blanks elsewhere.

The user-item rating matrix has one row for each user and one column for each item, and the entry in row uu and column ii holds what is known about the pair: a rating, a count, a mark that an event took place, or a blank. It is the common input of collaborative filtering and of the recommendation problem. In real data most entries are blank, and a blank means that the value is unknown, not that it is zero.

Definition

Let UU be a set of mm users and II a set of nn items. A rating matrix is a partial function R:U×I→VR : U \times I \to V, written as an m×nm \times n array whose entry ruir_{ui} is either a value in VV or blank. The set of known pairs is K={(u,i):rui is not blank}K = \{ (u, i) : r_{ui} \text{ is not blank} \} and s=∣K∣s = |K|.

  • Explicit data. VV is a rating scale, such as {1,2,3,4,5}\{1, 2, 3, 4, 5\}, and ruir_{ui} is a rating that uu gave to ii.
  • Implicit data. VV is {1}\{1\} for an event such as a purchase or a click, or the positive numbers for a count or a time. Pairs without an event are often stored as 0, but the 0 then means "no event seen", which is not the same as "disliked".

The density of RR is s/(mn)s / (m n). The row of uu gives Iu={i:(u,i)∈K}I_u = \{ i : (u, i) \in K \}, the items that uu rated, and the column of ii gives Ui={u:(u,i)∈K}U_i = \{ u : (u, i) \in K \}, the users who rated ii. For two users, the co-rated items are Iu∩IvI_u \cap I_v, and for two items, the common users are Ui∩UjU_i \cap U_j; neighborhood methods compare rows or columns on these sets only.

Because ss is usually far below mnm n, the matrix is stored as a sparse matrix: a list of triples (u,i,rui)(u, i, r_{ui}), or compressed sparse rows for fast access to each IuI_u, and the same by columns for each UiU_i. The storage is O(s+m+n)O(s + m + n), not O(mn)O(m n).

The blanks are not a random sample of the pairs. Users choose what to rate, and they tend to rate what they expect to like. Marlin and Zemel (2009) study models in which the chance that an entry is blank depends on its value, and show that ignoring this can bias both the predicted ratings and the rankings.

Examples and non-examples

The toy matrix of this group has four users, four items, s=14s = 14 and density 14/16=0.87514/16 = 0.875, with the two blanks ru1i3r_{u_1 i_3} and ru4i1r_{u_4 i_1}:

i1i_1 i2i_2 i3i_3 i4i_4
u1u_1 5 4 - 1
u2u_2 4 5 4 2
u3u_3 1 2 2 5
u4u_4 - 1 1 4

Here Iu1={i1,i2,i4}I_{u_1} = \{i_1, i_2, i_4\}, Ui3={u2,u3,u4}U_{i_3} = \{u_2, u_3, u_4\}, and the co-rated items of u1u_1 and u4u_4 are {i2,i4}\{i_2, i_4\}.

  • Its binary form. Replace every known rating by 1 and every blank by 0. The result records only which items each user rated. Koren (2008) uses this matrix as implicit feedback in SVD++, since the fact of rating says something about the user even when the value is not used.
  • The Netflix Prize data. More than 100 million ratings of about 500,000 customers for more than 17,000 films (Koren, Bell and Volinsky, 2009). From these rounded counts, the density is about 1 percent.
  • Non-example: blanks filled with zeros. The dense matrix with 0 in every blank of the toy matrix is a different object. A truncated singular value decomposition of it fits the zeros as if they were ratings and predicts low values for all unseen items. Methods for rating matrices sum over KK only.
  • Non-example: an item feature matrix. A matrix with a row per item and a column per feature, such as genres or words, describes the items, not the users. It is the input of content-based filtering. The term-document matrix of latent semantic analysis has a similar shape, but its zeros are known values: the word does not occur.
  • The bipartite view. RR is the weighted adjacency matrix of a bipartite graph with users on one side, items on the other, and an edge for each known pair.
  • Low rank. Latent factor models such as matrix factorization assume that the full matrix, with every blank filled by the true value, is close to a matrix of low rank. Matrix completion studies when such a matrix can be recovered from the known entries.
  • Implicit feedback. Implicit feedback is the case of event data, with its own treatment of the blanks.
  • Similarity of rows and columns. Cosine similarity on centered ratings, and Jaccard similarity on binary rows, compare two users or two items.

References

  1. Charu C. Aggarwal, Recommender Systems, The Textbook, Springer, 2016, Chapter 2 (the ratings matrix, its sparsity, and the users and items that neighborhood methods compare on it)
  2. Yehuda Koren, Robert Bell and Chris Volinsky, Matrix factorization techniques for recommender systems, IEEE Computer 42(8), 30-37, 2009, sections Recommender system strategies (explicit and implicit feedback) and A basic matrix factorization model (the sparse rating matrix and the fit to the observed entries only)
  3. Yehuda Koren, Factorization meets the neighborhood, a multifaceted collaborative filtering model, Proceedings of the 14th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2008), 426-434, Section 2.5 (the binary matrix of rated and not rated as implicit feedback)
  4. Benjamin M. Marlin and Richard S. Zemel, Collaborative prediction and ranking with non-random missing data, Proceedings of the Third ACM Conference on Recommender Systems (RecSys 2009), the models in which the chance that a rating is missing depends on its value, and their effect on prediction and ranking

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/YWE719/text.yaml