|
1 | | -# TODO |
| 1 | +# Recommendation Engine |
| 2 | +***A recommendation engine is a tool that predicts what a user will like among a list of items.*** |
2 | 3 |
|
3 | | -- set Array.prototype.contains to be non-iterable |
4 | | -- write readme |
| 4 | + |
| 5 | + |
| 6 | +## How it works |
| 7 | +A simple recommendation engine has four parts: |
| 8 | +- a set of users |
| 9 | +- a set of items (e.g. videos) |
| 10 | +- ratings that join users and items (e.g. thumbs on YouTube) |
| 11 | +- a program that maps this information to predictions (AKA recommendations) of what items a user will like. |
| 12 | + |
| 13 | +Our program is based on the **assumption** that users have similar preferences, i.e. one user liking an item means similar users will probably like that item too. |
| 14 | + |
| 15 | +## Concepts |
| 16 | +To determine which users are similar, it's helpful to think about the union and intersection of preference sets. |
| 17 | + |
| 18 | +### Sets |
| 19 | +**union**: *the set comprised of items that appear in both input sets.* |
| 20 | +E.g. `[1,2,3] u [1,3,4] -> [1,3]` |
| 21 | + |
| 22 | +**intersection**: *the set comprised of items that appear in only one of the input sets.* |
| 23 | +E.g. `[1,2,3] n [1,3,5] -> [2,5]` |
| 24 | + |
| 25 | +### Similarity |
| 26 | +**Similarity**: *A user is similar if they have more in common than not.* |
| 27 | +We can represent this by looking at the number of elements in the union of two users' preferences over the total items those users have rated, or `A u B / A + B` |
| 28 | + |
| 29 | +A more advanced concept is that users who disagree about an item (e.g. a likes 1, b *dis*likes 1) are more dissimilar than those who do not (e.g. a likes 1, b likes 2). |
| 30 | + |
| 31 | +### Predicting Preferences |
| 32 | +Once you determine a users' similarity, you can look for items your target user has not yet rated, and see if similar users liked that item. |
| 33 | + |
| 34 | +### Recommendations |
| 35 | +**Recommendations**: *An list of items, ordered such that the item with the greatest probability of being liked is first.* |
| 36 | + |
| 37 | +Generating a list of recommendations is straightfoward: |
| 38 | +1. getting a list of items the target user has not yet rated |
| 39 | +2. predicting the probability the target user will like each item |
| 40 | +3. sorting the resulting items by greatest probability of being liked first. |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +Sources: http://www.toptal.com/algorithms/predicting-likes-inside-a-simple-recommendation-engine |
0 commit comments