Mctaba Labs logo
BootcampThe WhiteboardProjectsEventsMasterclassesWebinarsLearn
Book CallApply

500+ developers already in the community

Get answers, find accountability partners, and stay ahead

Join Discord →
Mctaba Labs logo

Educating 1 million students in tech by 2030.

Programs

  • Coding Bootcamp in Nairobi
  • Software Engineering Bootcamp
  • Data Science to AI Engineering
  • HighSchool Graduates Launchpad
  • AI & Business Automation
  • Corporate Training
  • Kids & Teens
  • McTaba Story & Mission
  • Full-Stack Curriculum
  • Course Pricing & Plans
  • Frequently Asked Questions

Resources

  • Join Discord Community
  • Tech Events in Nairobi
  • Masterclasses
  • Free Resources
  • Learn
  • Data Science Guides
  • African Payments Reference
  • Campus
  • Africa Tech Talent Report
  • Partner With Us
  • Start a Project
  • Software & AI Studio
  • Our Work
  • Outcomes

Contact Us

  • 124 Manyani East Road, Lavington, Nairobi
  • +254727795603
  • Book a Discovery Call

Office Hours:

Mon-Fri: 9am - 2pm EAT

Sat: 10am - 12pm EAT

© 2026 Mctaba Labs - A product of Edtech Industries. All rights reserved.

Privacy PolicyTerms of ServiceRefund Policy
  1. Learn
  2. Data Science in Kenya
  3. How a Recommendation Feed Decides What You See
Bonaventure OgetoBy Bonaventure Ogeto|Updated November 3, 2026

Last checked 3 November 2026

How a Recommendation Feed Decides What You See

A recommendation feed scores items for you using three ideas: what people like you chose (collaborative filtering), what the item is like (content-based matching), and how you react (engagement signals). It then ranks the highest scores first, and learns from whatever you do next.

In this article

  1. 1. The problem every feed solves
  2. 2. Collaborative filtering: people like you
  3. 3. Content-based: items that look alike
  4. 4. Engagement signals: how you react
  5. 5. Build a tiny recommender yourself
  6. 6. What to take away

The problem every feed solves

McTaba runs coding and data bootcamps in Kenya. This guide is written to be useful whether or not you ever join one.

Picture a matatu stage at 6 PM. Fifty touts shout fifty destinations. You listen to one, the one you need. A feed has the same job for millions of videos or thousands of products: pick the few you will care about, fast.

The job has two steps. First, narrow millions of items to a few hundred candidates. Second, score the candidates and sort them. The three ideas below decide the scores. If you are weighing recommenders as a career area, our data science career map for Kenya shows how they fit among other roles.

IdeaIt asksIt needs
Collaborative filteringWhat did people like you choose?Many users and their history
Content-basedWhat is this item like?Descriptions of items
Engagement signalsHow did you react just now?Likes, watch time, skips, purchases

If you want to build a recommender yourself, the Data Science to AI Engineering programme covers clustering, online learning and bandits, which are the methods that sit behind live feeds.

Collaborative filtering: people like you

This idea ignores what an item is. It only looks at who chose it. For example, imagine a Jumia-style online shop with four made-up customers and the items they bought:

  • For example, Amina bought a kettle, a blender and an iron.
  • For example, Brian bought a kettle and a blender.
  • For example, Cheptoo bought a kettle and an iron.
  • For example, Daudi bought a blender.

Now Daudi opens the shop. What do we show him? Look for the other customers who share his blender. Amina and Brian bought a blender too. Between them they also bought a kettle (both) and an iron (Amina). The kettle appears twice among his neighbours, the iron once. So the kettle ranks first.

Real systems do this on millions of rows, usually by comparing items. In 2003, Amazon engineers described exactly that: item B is related to item A if people who buy A are more likely to buy B than the average customer (Linden, Smith and York, IEEE Internet Computing, checked on 3 November 2026).

The weakness is the cold start. A new product with no buyers has no neighbours. A new user with no history is anonymous. Both need another idea.

Get weekly developer tips

Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.

No spam. Unsubscribe anytime.

Content-based: items that look alike

This idea reads the item itself. A shop gives each product tags: category, brand, price band, colour. A video app reads the caption, sound and hashtags. Then it recommends items whose tags overlap with what you chose before.

For example, imagine you just bought a 2-litre electric kettle with tags "kitchen, appliance, 2 litres, stainless". A new toaster tagged "kitchen, appliance, stainless" overlaps on three tags out of four. A school bag overlaps on none. The toaster scores higher.

A common way to score the overlap is to turn the tags into a list of numbers and measure the angle between two lists, called cosine similarity. You do not need the formula to grasp it: more shared tags means a smaller angle and a higher score.

This fixes the cold start for new items, because a new toaster has tags on day one. Its weakness is sameness. If you buy one kettle, you see kettles for a month. Systems add variety on purpose to avoid it.

Engagement signals: how you react

Platforms learn from what you do, not only from what you say. TikTok's own explanation lists three kinds of input: user interactions such as the videos you like or share and accounts you follow; video information such as captions, sounds and hashtags; and device and account settings such as language, country and device type, which it says receive lower weight (TikTok Newsroom, checked on 3 November 2026). The same page says follower count is not a direct factor in the recommendation.

The idea in the engagement row is a ranking of strengths. A purchase tells a shop more than a click. A video watched to the end tells an app more than a quick scroll past. Think of it as weighing evidence, the same as a loan officer trusts a repaid loan more than a promise.

Platforms do not publish their exact weights. Treat any blog post that claims to know the secret formula with suspicion. What you can learn from their own pages is the kinds of signals, not the numbers.

Why feeds feel sticky

  • The system tries things. A recommender must test new items to learn, a trade-off called explore versus exploit.
  • Your reaction becomes the next training row, so the feed adapts within a session.
  • The goal it optimises, such as watch time, may not be your goal. Notice this when a feed feels draining.

Build a tiny recommender yourself

You can try collaborative filtering in about fifteen lines. This code uses the four made-up customers above.

from collections import Counter

baskets = {
    "Amina":   {"kettle", "blender", "iron"},
    "Brian":   {"kettle", "blender"},
    "Cheptoo": {"kettle", "iron"},
    "Daudi":   {"blender"},
}

def recommend(user):
    mine = baskets[user]
    scores = Counter()
    for other, items in baskets.items():
        if other == user:
            continue
        overlap = len(mine & items)      # shared items
        if overlap == 0:
            continue
        for item in items - mine:          # things I do not own yet
            scores[item] += overlap
    return scores.most_common()

print(recommend("Daudi"))   # [('kettle', 2), ('iron', 1)]

Read it slowly. Each other customer votes for the items you lack, and the vote is stronger when you share more items. That is a working, if crude, recommender.

To go further, load a made-up table with pandas as in our first 30 days of Python, and try the same idea on a larger file. Then ask how you would test whether the recommendations help. That is an A/B test, covered in the statistics you actually need for data science.

What to take away

The names change, the shape does not. Candidates come from neighbours or from item descriptions, scores come from your behaviour, and a ranker sorts them. Production systems blend all three, add rules for variety, and watch for drift as tastes change.

For another worked model, see a machine learning example on a matatu route. To place recommenders in the wider field, read AI versus machine learning versus data science.

No school can promise you a job in this area. Recommenders are one branch of a wider skill set, and you can learn the base on free tools first. The Data Science to AI Engineering programme starts on 11 January 2027 and costs KES 140,000, if you prefer a class.

Key Takeaways

  • ✓Feeds use three ideas: people like you, items like this, and how you react.
  • ✓Collaborative filtering needs history, which new items and new users lack.
  • ✓Platforms publish the kinds of signals they use, not the exact weights.
  • ✓A working toy recommender fits in fifteen lines of Python.

Frequently Asked Questions

What is collaborative filtering in simple words?
It recommends items that people with tastes like yours chose, without looking at what the items are. If you and a stranger both bought the same three things, you may like what they bought next.
What is the cold start problem?
It is the trouble of recommending a brand new item or to a brand new user when there is no history. Content-based matching and popular-item lists help fill the gap.
Does TikTok use follower count to rank videos?
TikTok's own explanation says neither follower count nor past high-performing videos are direct factors (TikTok Newsroom, checked on 3 November 2026). Accounts with more followers may still get more views because they have a larger audience.
Can I build a recommender with Python?
Yes. A simple version needs a table of who chose what and about fifteen lines of code. Libraries add speed and better maths.

Learn data science on African data

KES 140,000

Data Science to AI Engineering: 5 months full time or 8 months part time, hybrid in Nairobi. Fraud, credit and M-Pesa data from Week 1, and every model deployed. Starts 11 January 2027.

See the Data Science programme

Need it live by next month? Our studio builds it

Related guides

  • Analyse Your M-Pesa Statement in Python
  • Build a Credit Score for a Chama from Contribution Records
  • Catching Mobile Money Fraud with Machine Learning

Keep reading

The Statistics You Actually Need for Data Science

Five statistics ideas do most of the work in data jobs. Each one comes with a small worked example you can check on paper.

Read more

Python for Data Science: Your First 30 Days

Thirty days, four weeks, one small script a week. Learn only the parts of Python that data work uses, with examples on made-up Kenyan shop data.

Read more

Machine Learning Explained with a Matatu Route

A worked machine learning example with made-up numbers: predicting how long a matatu takes from Thika Road to town, and what happens when the model is wrong.

Read more

AI vs Machine Learning vs Data Science: The Difference

Three terms people use as if they mean one thing. Here is what each means, how the jobs differ, and which one a beginner in Kenya should learn first.

Read more

Explore related topics

Breaking Into Tech

Practical, no-nonsense guides for anyone looking to start or change their career in tech. From choosing your first language to acing interviews.

Tech Salary Data

Transparent salary data for tech roles in Africa and worldwide, updated regularly with real market research.

AI Skills & Tools

Practical AI knowledge for developers. Build your first agent, get good at RAG, and pick the right AI coding tools for real work.

Bonaventure Ogeto

Bonaventure Ogeto

Founder and CEO, Mctaba Labs

Software engineer for 8+ years. He runs a Nairobi studio that ships products on M-Pesa, WhatsApp and AI, and teaches what the studio ships. He holds a BSc in Mathematics and Computer Science.

More about the author