This video introduces two foundational recommendation system approaches: content-based filtering, which recommends items similar to what a user has liked based on item features, and collaborative filtering, which recommends items based on preferences of similar users; collaborative filtering uses matrix factorization with user and item embeddings, where the dot product of embeddings predicts user preferences, and optimization methods like SGD or WALS minimize the difference between predicted and actual feedback, with weighted matrix factorization addressing the challenge of unobserved entries in sparse feedback matrices.
Content-Based vs Collaborative Filtering for Recommendation Systems
Added:hi there welcome back to our video series of building recommendation systems with tensorflow my name is wei and i'm a developer advocate at google in our last video we gave you an overview of recommendation systems and introduced several cool open source products from google to help you build powerful recommenders in this video we'll be covering content-based filtering and collaborative theory there are traditional recommendation models but are important concepts in recommendation system literature and will help pave the foundation for more advanced models that we'll be discussing in future episodes so there are many traditional approaches used to build recommendation systems one common approach is content-based theory content-based filtering uses item features to recommend other items similar to what a user likes based on previous actions or explicit feedback for example here we're illustrating four apps that have different features each row represents an app and each column represents a feature some apps are educational or science related some are relevant to health or healthcare some are simply time wasters when a user installs a house app we can recommend other health related apps to that user because they are similar to the installed health app another common approach is collaborative filtering one limitation with content-based filtering is that it only leverages item similarities what if we can use similarities between users and items simultaneously to provide recommendations this would allow for serendipitous recommendations namely recommending an item to user a based on the interest of a similar user b this is what collaborative filtering is able to do while item-based filtering is not here we are illustrating a feedback matrix of 4 users and 5 movies each row represents a user and each column represents a movie the green check mark means that a user has watched a particular movie we consider this an implicit feedback in contrast if a user gives a rating on the movie that would be an explicit feedback so as you can see here the user in the first row has watched the three movies harry potter shrek and the dark knight rises now for the user in the servo she has also watched the harry potter and shrek so it may make sense to recommend the dark knight rises to her since the first user has similar preference to her so that's the idea of collaborative theory but how do we do this in practice let's say we can assign a value between -1 to 1 to each user indicating their interest level for children's movies -1 means highest level of interest for children's movies and one means no interest at all in this case user number 3 likes children's movies a lot and user number 4 doesn't like children's movies at all we can also assign a value between -1 to 1 to each movie -1 means the movie is highly suitable for children and one means it's not for children at all now we can see shrek is really a great movie for children now these values become embedding for users and movies and the product of user embedding and moving betting should be higher for movies that we expected the user to like in this example we hand engineered embeddings and this embeddings are one dimensional now we can say we have another dimension to represent the users in the movies let's assign another value between -1 to 1 to each user indicating their interest level for blockbuster movies similarly we assign a value between -1 to 1 to each movie indicating whether it is blockbuster or not now we have hand engineered the second dimension of embeddings we can go on and add more dimensions if you want in practice these embeddings tend to be of much higher dimensions but we can learn those embeddings automatically which is the beauty of collaborative filtering models for the sake of user visualization we are sticking to two dimensions here we are illustrating 2d embeddings for the users and movies on the right our goal is to make sure that we can learn this embeddings so that the predictive feedback matrix is as close to the ground tools feedback matrix as possible here we denote user embeddings at u and item embeddings at v the product of u and v is a which is a predicted feedback matrix for example if we take the first row of u 1.1 and the first column of v 0.9.2 and compute the dot product it gives 0.88 which is the top left and most element in the predict feedback matrix so our optimization objective then becomes minimizing the summation of the squared difference between the feedback label and the predictive feedback as you can see in the mathematical form in blue we can solve this using either stochastic gradient descent sgd or weighted alternating list of squares was sgd i'm sure you have heard about it when you train your net neural networks sgd is a generic method wireless it's specific to this problem the idea of was is that for each iteration we alternate between fixing u and solve for v and then fixing v and solving for u we won't go into the mathematical details but i should point out that sgd and walls each have their own advantages and disadvantages for example was usually converged is much faster than sgd wire sgd is more flexible and can handle other loss functions but so far we only cared about observe the item items what about the unobserved ones so observe the only matrix factorization is not good because if you set the embeddings to all ones you have minimized the objective function which is clearly not we want so we need to take into account of the unobserved entries there are two approaches to handle this first we can treat all unobserved entries as 0 and then solve it using svd singular value decomposition we won't be reviewing linear algebra here but you should know that svd is not very good at this because the a matrix tends to be very sparse in practice so the svd solution tends to have poor generalization capabilities a better approach is weighted matrix factorization in this case we still treat unobserved entries as zero but we scale the unobserved part of the object function highlighted in orange so that it's not overweighted as you can see the weight w0 is now a hyperparameter you need to tune now to sum up today we first introduced the content-based filtering and then covered collaborative filtering quite a bit i've listed out a few links of documentation and code implementation of collaborative filtering models based on tensorflow these implementations are using tensorflow core api in our next video we'll be introducing you to tensorflow recommenders which makes it a lot easier to build recommendation models see you next time [Music] you
Up Next

Two-Tower Neural Network Recommendation System Implementation
@harshbhatt7585
1.4K views•2025-04-20

BitTorrent Protocol Explained: Piece Selection & Peer Choking
@StevenGordonAU
481 views•2013-02-22

Building a TensorFlow Ranking Model with TF Recommenders
@TensorFlow
27.5K views•2021-07-20

Enigma Machine Mechanics: WWII Encryption Explained
@JaredOwen
13.2M views•2021-12-11
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Computer Science





























![[DS Interface] Neural Collaborative Filtering](https://i.ytimg.com/vi/rg6C68BQvXk/maxresdefault.jpg)









