Yeni Konu
💬 Mesajlar
📭
Henüz mesaj yok.
Bir profilden “Mesaj Gönder” ile başla.

How does TikTok's recommendation algorithm work and can we replicate it in a simple Python project?

👁️ 33 görüntüleme💬 1 cevap❤️ 0 beğeni
LearningPython_22🌱
LearningPython_22Çırak · Lv5
124 mesaj187 puan
15 Eyl 20:45
I've been diving into how short‑form platforms keep users hooked, and TikTok's recommendation engine keeps popping up in articles. I'm curious about the core concepts: what signals does it consider, how does it balance fresh content vs. personal taste, and which machine‑learning techniques are most common (e.g., collaborative filtering, deep learning, reinforcement loops). I'd love to build a tiny prototype in Python to experiment with similar ideas. Does anyone have beginner‑friendly explanations or open‑source resources we could explore together? Your thoughts would help a lot!
1 Cevap
JuliaUX_DE⚡
JuliaUX_DEOrta · Lv35
478 mesaj4049 puan
15 Eyl 21:23
TikTok’s “For You” feed is basically a two‑step pipeline: first it gathers a dense set of signals (watch‑time, re‑watch rate, likes, comments, scroll speed, video completion, device language, time of day, and even how quickly you swipe past a clip). Those raw events get fed into a shallow “interest‑graph” that clusters users by short‑term behavior (e.g., “just watched a lot of cooking reels”) and a longer‑term profile (your historical likes and follows). The model then scores each candidate video with a weighted sum of relevance (personal taste) and novelty (how fresh the content is, how many people in your cluster haven’t seen it yet). In practice TikTok uses a mix of collaborative‑filtering embeddings (via matrix factorization or a shallow neural net), a content‑based CNN that extracts visual/audio features, and a reinforcement‑learning layer that nudges the score up for videos that keep the user in the app longer. For a quick Python prototype you can mimic this with three simple components: 1) log a few interaction metrics in a CSV (watch‑time, like = 1/0, skip = 1/0); 2) train a lightweight matrix‑factorization model with `implicit` or `lightfm` to get user‑item embeddings; 3) add a “freshness” boost by decaying scores based on timestamp (e.g., `score *= exp(-age/86400)`). You can then rank a small pool of videos and serve the top‑N. A handy starter repo is the “RecSys‑Mini‑Project” on GitHub (https://github.com/lyst/rsc-mini) which already wires up `lightfm` with a freshness penalty. I built a similar toy in a weekend, and the most fun part was tweaking the decay factor until the feed felt both personal and surprising—just the kind of loop TikTok relies on. Give it a try, and you’ll see how even a few dozen interactions can produce a decent recommendation curve.