Notes

User-Item Matrix

Line every user up as a row, every item in the catalogue as a column, and write down what each person did with each thing. The result is mostly empty — and that emptiness is the central fact of recommendation.

A sparse table, not a dense one
The user-item matrix has one row per user and one column per item, with each entry holding the observed interaction — a rating on a one-to-five scale, a binary clicked flag, or a count of plays. With a million users and a million items that is a trillion cells, of which perhaps a few hundred million are filled: sparsity above 99.9% is normal. Nobody stores it as a dense array; it lives as a list of (user, item, value) triples in a sparse format such as CSR.

What the blanks mean
A blank is not a zero. With explicit ratings it means “not rated”, and scoring it as a low rating poisons the model. With implicit feedback it is ambiguous — unseen or disliked, indistinguishable — which is exactly why implicit ALS treats every blank as a weak negative with low confidence rather than a hard zero.

Why it frames everything
Collaborative filtering is defined as learning from this matrix alone: matrix completion predicts its missing entries, factorisation approximates it as the product of two thin factor matrices, and neighbourhood methods compare its rows or columns. The MovieLens 25M file is a sparse matrix in disguise.

The user-item matrix is the table with one row per user, one column per item, and each observed interaction in the corresponding cell. It is the canonical input to collaborative filtering, which learns from it alone. Its defining property is extreme sparsity — well over 99% of cells are empty — and those blanks mean unobserved, not disliked, a distinction every factorisation and neighbourhood method has to handle explicitly.

Imagine a giant attendance sheet: every customer gets a row, every product in the shop gets a column, and you tick the box whenever someone buys something. Almost every box stays blank, because nobody buys more than a handful of things.

That sheet is the user-item matrix, and filling in its blanks is what a recommendation system actually does. The few ticks you have made tell it which other customers resemble you, and their ticks suggest what you might want next. The blanks are the interesting part — they are not refusals, just things you have never come across.