…
…
Work out a recommendation by hand from the watch history of a fictional club video page, calculate how the feed narrows every round, measure diversity, and write and test your own rule to break the bubble.
The university's film and video club collects the short videos its members make on its own small page, Club Feed: game reviews, music performances, science experiments, cooking recipes. The page shows each member a list of recommendations based on their watch history. Club president Lena received a complaint. A member, Ethan, wrote: "My feed is game videos from top to bottom. I still love science videos, but now I never see them."
Lena wants two things from you: to explain with numbers why the recommendation logic always shows Ethan games, and to propose a rule that does not narrow the feed. In this project you will run the recommendation by hand, calculate how the feed narrows, measure diversity, and test your own rule.
| Step | What you will do |
|---|---|
| 1–2 | Get to know the watch history table and set up the language of the table (example, feature, label) |
| 3–5 | Find the member most similar to Ethan, work out the recommendation by hand, and write what the recommendation predicts |
| 6–7 | Run the feed loop for two rounds and calculate the diversity score |
| 8–9 | Write a rule to break the bubble and test an example rule with numbers |
| 10 | Write Lena a note with your decision and its cost |
Lessons used: systems that predict, recommend, and generate; the recommendation loop and the filter bubble (2); example, feature, label, a column not available at prediction time, who gave the label (5).
You will not write code. You will read numbers from the tables and calculate, and write your decisions in your own sentences. The calculations use the four basic operations; you may use a calculator. The club, the members, the videos, and all the numbers are fictional example data written for this project. Estimated time: 35–40 minutes.
What you'll do
Required topics
Code cells are for members
You can read the steps. Sign up free to run the code, complete the steps and save your progress.
Lena pulled the records of five members from the last week of watch history on Club Feed (fictional example data). The page has seven videos: V1, V2, and V7 are game reviews, V3 is a music performance, V4 and V6 are science experiments, and V5 is a cooking recipe. Each row in the table is one view: which member opened which video, how long the video is, at which minute they closed it, and whether they watched to the end.
| # | Member | Video | Type | Length (min) | Watched (min) | Finished |
|---|---|---|---|---|---|---|
| 1 | Ethan | V1 | game | 8 | 8 | yes |
| 2 | Ethan | V2 | game | 12 | 12 | yes |
| 3 | Ethan | V3 | music | 5 |
Code cells are for members
You can read the steps. Sign up free to run the code, complete the steps and save your progress.
| yes |
| 4 | Ethan | V4 | science | 10 | 3 | no |
| 5 | Maya | V1 | game | 8 | 8 | yes |
| 6 | Maya | V2 | game | 12 | 12 | yes |
| 7 | Maya | V3 | music | 5 | 5 | yes |
| 8 | Maya | V7 | game | 9 | 9 | yes |
| 9 | Maya | V5 | cooking | 6 | 2 | no |
| 10 | Diego | V4 | science | 10 | 10 | yes |
| 11 | Diego | V5 | cooking | 6 | 6 | yes |
| 12 | Diego | V6 | science | 14 | 14 | yes |
| 13 | Diego | V1 | game | 8 | 1 | no |
| 14 | Nadia | V1 | game | 8 | 8 | yes |
| 15 | Nadia | V4 | science | 10 | 10 | yes |
| 16 | Nadia | V6 | science | 14 | 14 | yes |
| 17 | Nadia | V3 | music | 5 | 2 | no |
| 18 | Ravi | V2 | game | 12 | 12 | yes |
| 19 | Ravi | V3 | music | 5 | 5 | yes |
| 20 | Ravi | V6 | science | 14 | 14 | yes |
| 21 | Ravi | V7 | game | 9 | 4 | no |
A recommender always starts with a table like this: a record of who looked at what, and for how long (lesson 2). The system does not know Ethan; all it has is these rows. Before you calculate, count the table and learn its size: how many rows, how many members, how many different videos, how many views ran to the end, and which type has the most rows.
This step's code cell is for members.Sign up free
What will the system learn from this table? The goal of Club Feed is to predict this question: if a member opens a video, will they watch it to the end? The system puts the videos with a high chance of being watched first.
Use the language from lesson 5. Each row is an example. The column we want to predict is the label. The other columns the model looks at are features. For a column to be a feature, ask the question from lesson 5: before the video is put in the recommendation list, that is, at prediction time, is this value available?
Look closely at the Watched (min) column. This value almost gives away whether the video was finished; but when the video has not been recommended yet, is it known at which minute it will be closed?
Think about the label itself too (lesson 5: who gave the label?). Nobody asked Ethan "did you like this video?" The label comes from a rule the system set: if they watched to the end, "yes." Ethan closed the science video in row 4 at minute 3. The reason could be that he did not like it; but it could also be that class started, his phone ran out of battery, or he wanted to watch the 10-minute video later. The system cannot see this difference.
This step's code cell is for members.Sign up free
Now run the recommendation method from lesson 2 by hand for Ethan. The first job is to turn the watch history into a like table. Each cell says: 1 = the member finished the video, 0 = opened it but did not finish, empty (–) = never opened it. Ethan's row is ready:
| Member | V1 | V2 | V3 | V4 | V5 | V6 | V7 |
|---|---|---|---|---|---|---|---|
| Ethan | 1 | 1 | 1 | 0 | – | – | – |
| Maya | |||||||
| Diego | |||||||
| Nadia | |||||||
| Ravi |
Fill in the rows of the other four members yourself from the table in step 1 (on paper or in your head). Then find each member's shared finishes with Ethan: of the videos Ethan finished (V1, V2, V3), how many did that member also finish? V4, which Ethan did not finish, does not count; videos where both members have a 1 count.
Why do we look at shared finishes? The idea is the same as in lesson 2: if the person whose taste is most like yours finished something, you will probably finish it too. Here the system uses "finishing" in place of "taste"; in step 2 you saw why these are not exactly the same thing.
This step's code cell is for members.Sign up free
The recommendation rule is the three steps from lesson 2:
1. Choose the member with the most shared finishes with Ethan.
2. Find the videos that member finished but Ethan never opened.
3. Recommend that video. If the most similar member has no new video to recommend, move on to the next most similar member.
First apply the rule and enter the number of the recommended video (write 7 for V7). Then a "what if" question: if Maya were not there, who would be the next most similar member, and which video would they recommend?
Finally, calculate how the recommendation will change Ethan's history. Ethan has finished 3 videos so far: V1, V2 (game), and V3 (music). Assume he finishes the recommended video too. What percentage of the videos he finished would be game? This number is the data the system has at the next recommendation.
This step's code cell is for members.Sign up free
The system recommended V7 to Ethan. Remember Ethan's complaint: he still likes science videos. The science video V6 was Ravi's suggestion and was never shown to Ethan.
Here you will test the misunderstanding from lesson 2: a recommender does not find "the best for you," it finds the most likely view. All the system has is a record of who finished what. It does not know what Ethan likes, what he is curious about, or why he left the science video halfway.
Ask yourself one more thing: what exactly do Ethan and Maya have in common? Two of the three shared finishes are game videos. The similarity measure rewarded watching games.
This step's code cell is for members.Sign up free
A single recommendation is a small step. Ethan's complaint, though, built up over weeks. Let's run the loop from lesson 2 on Ethan's feed.
Lena pulled a summary of Ethan's last four weeks (fictional example data). In these four weeks the feed showed the same number of videos of each type:
| Type | Shown | Finished by Ethan | Finish rate |
|---|---|---|---|
| game | 10 | 6 | ? |
| music | 10 | 4 | ? |
| science | 10 | 2 | ? |
| cooking | 10 | 2 | ? |
Finish rate = finished ÷ shown. We take these rates as Ethan's interest and, as in lesson 2, assume it does not change: Ethan is the same person from round to round.
The feed's rule is:
1. Each type has a share (what percent of the feed is that type). At the start (round 0) the four types have equal shares: 25% each.
2. In each round, for each type, score = share × finish rate is calculated.
3. The next round's share for a type is its score divided by the total of all scores: new share = score ÷ total score × 100.
Example: in round 0 the score of game is 25 × 0.6 = 15. Add the scores of the four types and find the new share of game. Then repeat the same process with the shares of round 1 and calculate round 2. Write the shares with one decimal place (e.g., 42.9).
This step's code cell is for members.Sign up free
We ran the same rule for five rounds on a computer. The shares (percent, one decimal):
| Round | game | music | science | cooking |
|---|---|---|---|---|
| 0 | 25.0 | 25.0 | 25.0 | 25.0 |
| 1 | 42.9 | 28.6 | 14.3 | 14.3 |
| 2 | 60.0 | 26.7 | 6.7 | 6.7 |
| 3 | 73.0 | 21.6 | 2.7 | 2.7 |
| 4 | 81.8 | 16.2 | 1.0 | 1.0 |
| 5 | 87.7 | 11.6 | 0.4 | 0.4 |
Telling Lena "the feed narrowed" is not enough; we want to show how much it narrowed with a single number. For this we will use a diversity score. Imagine you pick two videos at random from the feed: what is the probability that the two are of different types? The calculation is:
diversity score = 1 − (sum of the squares of each type's share)
Write the shares as decimals (25% → 0.25). In round 0: 1 − (0.25² + 0.25² + 0.25² + 0.25²) = 1 − 0.25 = 0.75. This is the highest score possible with four equal types. If the feed is left with a single type, the score is 0: both videos are of the same type.
Let's also see why the system likes this rule. On a page of 20 videos, Ethan's expected number of finishes = 20 × (sum of each type's share × finish rate). The finish rates are from step 6: 0.6 · 0.4 · 0.2 · 0.2.
This step's code cell is for members.Sign up free
Now you have two numbers and they move in opposite directions: diversity falls while the number of finishes rises. This is exactly the filter bubble from lesson 2: a person sees similar things inside a bubble woven by their own clicks and does not notice it.
Lena wants a rule from you to add to the feed. The rule must be written with numbers so it can be tested in step 9. Some possible directions:
Your rule will have a cost: you saw in step 7 that as the feed narrowed, the expected number of finishes rose. Opening up the feed will lower this number somewhat. When you write the rule, also say whether you accept this cost.
This step's code cell is for members.Sign up free
Lena has a draft rule too. We will compare it with the feed at round 3; if it is like your own rule, the results will guide you as well.
Lena's rule (20-video page):
1. Each type first gets 3 slots.
2. A single type can take at most 8 slots.
3. The remaining slots are filled starting from the type with the highest finish rate; when a type reaches the ceiling, move on to the next type.
First apply the rule: after giving each type 3 slots, how many slots are left? Game can take as many more slots as it can until the ceiling, and the rest goes to music. Then calculate the shares of the page and find the diversity score and the expected number of finishes with the method from step 7. The finish rates are again 0.6 · 0.4 · 0.2 · 0.2.
With this rule the loop can no longer grow the shares: because the page is built with the same rule every round, the feed does not narrow as it did in round 3.
This step's code cell is for members.Sign up free
Lena will present Ethan's complaint and your proposal at tomorrow's club meeting. Write her a five-sentence note. Give each sentence one job:
1. Cause: Why the feed always shows Ethan games (the recommendation rule and the loop, with one number).
2. Measure: How diversity changed (with the numbers from step 7).
3. Rule: Which rule you propose (your own rule or Lena's).
4. Cost: What the rule costs and why that is acceptable (with the numbers from step 9).
5. User: What Ethan himself can do (the options from lesson 2: watch other types on purpose, say "not interested," clear the history).
Add one warning: all the calculations rest on the assumption that Ethan's interest does not change and on a small table of five members.
This step's code cell is for members.Sign up free