9.7 Collaborative Filtering | Finding related items-- [Machine Learning| Andrew Ng]
 If you go to an online shopping website and are looking at a specific item, say maybe a specific book, the website may show you things like, here are some other books similar to this one. Or if you're browsing a specific movie, it may say, here are some other movies similar to this one. How do the websites do that so that when you look at one item, it gives you other similar related items to consider? It turns out the collaborative filtering algorithm that we've been talking about gives you a nice way to find related items. Let's take a look. As part of the collaborative filtering we've discussed, you learn features XI for every item I, for every movie I or other type of item that you're recommending to users. Whereas earlier this week, I had used a hypothetical example of the features representing how much a movie is a romance movie versus an action movie. In practice, when you use this algorithm to learn the features XI automatically, looking at the individual features like X1, X2, X3, you find them to be quite hard to interpret. It's quite hard to look at the features and say, oh, X1 is an action movie and X2 is a foreign film and so on. But nonetheless, these learned features collectively, X1 and X2 or X1, X2, X3, however many features in you have, collectively these features do convey something about what that movie is like. And it turns out that given features XI of item I, if you want to find other items, say other movies related to movie I, then what you can do is try to find the item K with features XK that is similar to XI. And in particular, given a feature vector XK, the way we determine whether or not it's similar to the feature XI is as follows. Use the sum from L equals 1 through N with N features of XKL minus XIL squared. This turns out to be the square distance between XK and XI. And in math, this square distance between these two vectors XK and XI is sometimes written as follows as well. And if you find not just the one movie with the smallest distance between XK and XI, but find, say, the five or 10 items with the most similar feature vectors, then you end up finding five or 10 related items to the item XI. So if you're building a website and want to help users find related products to a specific product they're looking at, this would be a nice way to do so. Because the features XI give a sense of what item I is about, other items XK with similar features will turn out to be similar to item I. It turns out later this week, this idea of finding related items will be a small building block that we'll use to get to an even more powerful recommender system as well. Before wrapping up this section, I want to mention a few limitations of collaborative filtering. In collaborative filtering, you have a set of items and a set of users, and the users have rated some subset of items. One of its weaknesses is that it's not very good at the code start problem. For example, if there's a new item in your catalog, say someone's just published a new movie and hardly anyone has rated that movie yet, how do you rank the new item if very few users have rated it before? Similarly, for new users that rated only a few items, how can we make sure we show them something reasonable? We did see in an earlier video how mean normalization can help with this, and it does help a lot. But perhaps there are even better ways to show users that rated very few items, things that are likely to interest them. This is called the code start problem because when you have a new item that few users have rated, or when you have a new user that's rated very few items, the results of collaborative filtering for that item or for that user may not be very accurate. A second limitation of collaborative filtering is it doesn't give you a natural way to use side information or additional information about items or users. For example, for a given movie in your catalog, you might know what is the genre of the movie, who are the movie stars, what is the studio, what is the budget, and so on. You may have a lot of features about a given movie. Or for a single user, you may know something about their demographics, such as their age, gender, location. They express preferences such as if they tell you they like certain movie genres but not other movie genres. Or it turns out if you know the user's IP address, that can tell you a lot about the user's location. And knowing the user's location might also help you guess what might the user be interested in. Or if you know whether the user is accessing your site on a mobile or on a desktop, or if you know what web browser they're using, it turns out all of these are little cues you can get that can be surprisingly correlated with the preferences of a user. It turns out, by the way, that it's known that users that use the Chrome versus Firefox versus the Safari versus the Microsoft Edge browser, they actually behave in very different ways. So even knowing the user web browser can give you a hint when you have collected an updater of what this particular user might like. So even though collective filtering, where you have multiple users give you ratings of multiple items is a very powerful set of algorithms, it also has some limitations. In the next video, let's go on to develop content based filtering algorithms, which can address a lot of these limitations. Content based filtering algorithms are a state of the art technique used in many commercial applications today. Let's go take a look at how they work.
[{"start": 0.0, "end": 8.2, "text": " If you go to an online shopping website and are looking at a specific item, say maybe"}, {"start": 8.2, "end": 13.280000000000001, "text": " a specific book, the website may show you things like, here are some other books similar"}, {"start": 13.280000000000001, "end": 14.280000000000001, "text": " to this one."}, {"start": 14.280000000000001, "end": 19.12, "text": " Or if you're browsing a specific movie, it may say, here are some other movies similar"}, {"start": 19.12, "end": 20.36, "text": " to this one."}, {"start": 20.36, "end": 25.0, "text": " How do the websites do that so that when you look at one item, it gives you other similar"}, {"start": 25.0, "end": 27.240000000000002, "text": " related items to consider?"}, {"start": 27.24, "end": 31.72, "text": " It turns out the collaborative filtering algorithm that we've been talking about gives you a"}, {"start": 31.72, "end": 34.4, "text": " nice way to find related items."}, {"start": 34.4, "end": 35.64, "text": " Let's take a look."}, {"start": 35.64, "end": 42.08, "text": " As part of the collaborative filtering we've discussed, you learn features XI for every"}, {"start": 42.08, "end": 47.68, "text": " item I, for every movie I or other type of item that you're recommending to users."}, {"start": 47.68, "end": 54.2, "text": " Whereas earlier this week, I had used a hypothetical example of the features representing how much"}, {"start": 54.2, "end": 57.96, "text": " a movie is a romance movie versus an action movie."}, {"start": 57.96, "end": 63.14, "text": " In practice, when you use this algorithm to learn the features XI automatically, looking"}, {"start": 63.14, "end": 70.52000000000001, "text": " at the individual features like X1, X2, X3, you find them to be quite hard to interpret."}, {"start": 70.52000000000001, "end": 78.0, "text": " It's quite hard to look at the features and say, oh, X1 is an action movie and X2 is a"}, {"start": 78.0, "end": 80.08, "text": " foreign film and so on."}, {"start": 80.08, "end": 88.44, "text": " But nonetheless, these learned features collectively, X1 and X2 or X1, X2, X3, however many features"}, {"start": 88.44, "end": 95.96, "text": " in you have, collectively these features do convey something about what that movie is"}, {"start": 95.96, "end": 97.16, "text": " like."}, {"start": 97.16, "end": 104.28, "text": " And it turns out that given features XI of item I, if you want to find other items, say"}, {"start": 104.28, "end": 111.96000000000001, "text": " other movies related to movie I, then what you can do is try to find the item K with"}, {"start": 111.96000000000001, "end": 118.44, "text": " features XK that is similar to XI."}, {"start": 118.44, "end": 125.28, "text": " And in particular, given a feature vector XK, the way we determine whether or not it's"}, {"start": 125.28, "end": 128.96, "text": " similar to the feature XI is as follows."}, {"start": 128.96, "end": 136.76000000000002, "text": " Use the sum from L equals 1 through N with N features of XKL minus XIL squared."}, {"start": 136.76000000000002, "end": 143.12, "text": " This turns out to be the square distance between XK and XI."}, {"start": 143.12, "end": 151.4, "text": " And in math, this square distance between these two vectors XK and XI is sometimes written"}, {"start": 151.4, "end": 152.96, "text": " as follows as well."}, {"start": 152.96, "end": 160.0, "text": " And if you find not just the one movie with the smallest distance between XK and XI, but"}, {"start": 160.0, "end": 167.20000000000002, "text": " find, say, the five or 10 items with the most similar feature vectors, then you end up finding"}, {"start": 167.20000000000002, "end": 171.72, "text": " five or 10 related items to the item XI."}, {"start": 171.72, "end": 176.76000000000002, "text": " So if you're building a website and want to help users find related products to a specific"}, {"start": 176.76000000000002, "end": 181.42000000000002, "text": " product they're looking at, this would be a nice way to do so."}, {"start": 181.42, "end": 189.33999999999997, "text": " Because the features XI give a sense of what item I is about, other items XK with similar"}, {"start": 189.33999999999997, "end": 193.32, "text": " features will turn out to be similar to item I."}, {"start": 193.32, "end": 198.51999999999998, "text": " It turns out later this week, this idea of finding related items will be a small building"}, {"start": 198.51999999999998, "end": 205.11999999999998, "text": " block that we'll use to get to an even more powerful recommender system as well."}, {"start": 205.12, "end": 211.68, "text": " Before wrapping up this section, I want to mention a few limitations of collaborative"}, {"start": 211.68, "end": 212.68, "text": " filtering."}, {"start": 212.68, "end": 216.72, "text": " In collaborative filtering, you have a set of items and a set of users, and the users"}, {"start": 216.72, "end": 219.48000000000002, "text": " have rated some subset of items."}, {"start": 219.48000000000002, "end": 224.96, "text": " One of its weaknesses is that it's not very good at the code start problem."}, {"start": 224.96, "end": 229.84, "text": " For example, if there's a new item in your catalog, say someone's just published a new"}, {"start": 229.84, "end": 236.32, "text": " movie and hardly anyone has rated that movie yet, how do you rank the new item if very"}, {"start": 236.32, "end": 239.4, "text": " few users have rated it before?"}, {"start": 239.4, "end": 246.16, "text": " Similarly, for new users that rated only a few items, how can we make sure we show them"}, {"start": 246.16, "end": 248.36, "text": " something reasonable?"}, {"start": 248.36, "end": 255.66, "text": " We did see in an earlier video how mean normalization can help with this, and it does help a lot."}, {"start": 255.66, "end": 261.2, "text": " But perhaps there are even better ways to show users that rated very few items, things"}, {"start": 261.2, "end": 263.52, "text": " that are likely to interest them."}, {"start": 263.52, "end": 269.84, "text": " This is called the code start problem because when you have a new item that few users have"}, {"start": 269.84, "end": 276.6, "text": " rated, or when you have a new user that's rated very few items, the results of collaborative"}, {"start": 276.6, "end": 281.08, "text": " filtering for that item or for that user may not be very accurate."}, {"start": 281.08, "end": 286.03999999999996, "text": " A second limitation of collaborative filtering is it doesn't give you a natural way to use"}, {"start": 286.03999999999996, "end": 290.59999999999997, "text": " side information or additional information about items or users."}, {"start": 290.59999999999997, "end": 296.76, "text": " For example, for a given movie in your catalog, you might know what is the genre of the movie,"}, {"start": 296.76, "end": 301.52, "text": " who are the movie stars, what is the studio, what is the budget, and so on."}, {"start": 301.52, "end": 305.36, "text": " You may have a lot of features about a given movie."}, {"start": 305.36, "end": 310.79999999999995, "text": " Or for a single user, you may know something about their demographics, such as their age,"}, {"start": 310.8, "end": 312.44, "text": " gender, location."}, {"start": 312.44, "end": 317.76, "text": " They express preferences such as if they tell you they like certain movie genres but not"}, {"start": 317.76, "end": 320.0, "text": " other movie genres."}, {"start": 320.0, "end": 324.56, "text": " Or it turns out if you know the user's IP address, that can tell you a lot about the"}, {"start": 324.56, "end": 326.48, "text": " user's location."}, {"start": 326.48, "end": 331.8, "text": " And knowing the user's location might also help you guess what might the user be interested"}, {"start": 331.8, "end": 332.8, "text": " in."}, {"start": 332.8, "end": 339.44, "text": " Or if you know whether the user is accessing your site on a mobile or on a desktop, or"}, {"start": 339.44, "end": 343.64, "text": " if you know what web browser they're using, it turns out all of these are little cues"}, {"start": 343.64, "end": 348.64, "text": " you can get that can be surprisingly correlated with the preferences of a user."}, {"start": 348.64, "end": 353.28, "text": " It turns out, by the way, that it's known that users that use the Chrome versus Firefox"}, {"start": 353.28, "end": 358.24, "text": " versus the Safari versus the Microsoft Edge browser, they actually behave in very different"}, {"start": 358.24, "end": 359.24, "text": " ways."}, {"start": 359.24, "end": 364.2, "text": " So even knowing the user web browser can give you a hint when you have collected an updater"}, {"start": 364.2, "end": 366.4, "text": " of what this particular user might like."}, {"start": 366.4, "end": 371.59999999999997, "text": " So even though collective filtering, where you have multiple users give you ratings of"}, {"start": 371.59999999999997, "end": 377.4, "text": " multiple items is a very powerful set of algorithms, it also has some limitations."}, {"start": 377.4, "end": 382.32, "text": " In the next video, let's go on to develop content based filtering algorithms, which"}, {"start": 382.32, "end": 385.59999999999997, "text": " can address a lot of these limitations."}, {"start": 385.59999999999997, "end": 389.79999999999995, "text": " Content based filtering algorithms are a state of the art technique used in many commercial"}, {"start": 389.79999999999995, "end": 391.35999999999996, "text": " applications today."}, {"start": 391.36, "end": 398.36, "text": " Let's go take a look at how they work."}]