A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Collaborative Filtering

Graduate Depth 89 in the knowledge graph I know this Set as goal
501prerequisites beneath it
See this on the map →
Recommendation SystemsDimensionality Reduction Techniques
collaborative-filtering matrix-factorization user-item

Core Idea

Collaborative filtering predicts preferences by finding patterns in user-item interaction matrices. User-based approaches find similar users; item-based find similar items. Matrix factorization decomposes the interaction matrix into latent user and item factors. The core assumption is that similar users like similar items.

Explainer

From your study of recommendation systems, you know the basic goal: predict whether a user will like an item they haven't interacted with yet. Content-based approaches do this by analyzing item features (genre, description, attributes), but collaborative filtering takes a radically different approach — it ignores item features entirely and works solely from the pattern of who liked what. The fundamental insight is that if two users agreed on many items in the past, they are likely to agree on items in the future. You don't need to know *why* they liked those items — the agreement pattern is enough.

User-based collaborative filtering implements this directly. To predict whether user A will like a movie, find the users most similar to A (based on their shared rating history), then average those similar users' ratings for the movie in question. Similarity is typically measured by cosine similarity or Pearson correlation across the ratings vector. Item-based collaborative filtering flips the perspective: instead of finding similar users, it finds items similar to ones user A already liked (where "similar" means they tend to be rated similarly by the same users) and predicts ratings based on those item similarities. Item-based approaches tend to be more stable in practice because item similarity patterns change less frequently than user similarity patterns, and they scale better when there are fewer items than users.

Both approaches face a critical problem: the user-item matrix is extremely sparse. A typical platform might have millions of users and hundreds of thousands of items, but each user has interacted with only a tiny fraction — often less than 1% of all items. Computing similarities from such sparse vectors is noisy and unreliable. Matrix factorization addresses this by decomposing the sparse user-item matrix R into two smaller dense matrices: a user matrix U (each row is a user's latent factor vector) and an item matrix V (each row is an item's latent factor vector), such that R ≈ UVT. Each latent factor captures an abstract dimension of taste — perhaps one factor corresponds roughly to "preference for action vs. drama" and another to "tolerance for long runtime," though the factors are learned automatically and are not always interpretable.

The elegance of matrix factorization is that predicting user i's rating for item j becomes simply the dot product of their latent vectors: r̂ᵢⱼ = uᵢ · vⱼ. Training learns U and V by minimizing the prediction error on observed ratings (often with regularization to prevent overfitting to the sparse data). This approach, famously used by the winning entry in the Netflix Prize, handles sparsity gracefully because the low-rank factorization forces the model to generalize — it cannot simply memorize the few observed entries but must find coherent latent patterns that explain the entire matrix. The trade-off is the cold-start problem: collaborative filtering cannot recommend items that no one has rated yet, or make predictions for brand-new users with no history, since there are no interaction patterns to leverage.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersDividing IntegersUnit RatesProportionsPercent ConceptConverting Between Fractions, Decimals, and PercentsOperations with Rational NumbersTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionSine, Cosine, and Tangent RatiosTrigonometric Ratios ReviewVectors in Two DimensionsVector Operations: Addition, Subtraction, and Scalar MultiplicationDot Product (Inner Product in R^n)Matrix MultiplicationDeterminants of 2×2 and 3×3 MatricesInvertible Matrices and Matrix InversesSystems of Linear Equations and Matrix FormGaussian Elimination and Row ReductionRow Echelon Form and Back SubstitutionThe Standard Matrix of a Linear TransformationComposition of Linear TransformationsChange of Basis and Coordinate SystemsDiagonalizationPrincipal Component AnalysisDimensionality Reduction TechniquesCollaborative Filtering

Longest path: 90 steps · 501 total prerequisite topics

Prerequisites (2)

Leads To (0)

No topics depend on this one yet.