Skip to content
Personalisation

Predictive models

A predictive model learns from what has happened and estimates what is likely to happen next. In PEACH, that usually means: which content will this person want to see?

What a predictive model does

A model takes inputs (events, content metadata, context) and produces a prediction (a score, a category or a ranked list). It is trained on history and then applied to new situations, such as a user who opens the app right now.

Training and serving are separate steps. Training is slow and runs on a schedule. Serving has to be fast and runs on every request.

Kinds of prediction

Ranking and recommendation

Order content by how relevant it is for a person. This is the most common case in PEACH: "recommended for you", "up next", "similar programmes".

Classification

Predict a category, for example whether a user is likely to stop using a service, or which topic an article belongs to.

Regression

Predict a number, for example expected listening time or how many plays an item will get tomorrow.

Time series

Predict how a value develops over time, for example traffic peaks or the items that are starting to trend.

Models in PEACH

Model Learns from Typical use Needs item metadata
Trending Popularity across all users Fallback, anonymous users No
Content-based filtering Metadata of what a user consumed "More like this", new content Yes
Collaborative filtering Which users consumed which items Personalised lists No
Diversified Same as collaborative filtering Broader, less repetitive lists No
Embeddings Text, audio or behaviour turned into vectors Similarity search, semantic matching Optional

Models are plain Python. You can use the algorithms above as a starting point, change them, or bring your own library. Nothing in PEACH ties you to one method.

From data to prediction

Step 1 · Collect

Apps send events; they are stored as an event archive

Step 2 · Train

A scheduled task reads the events and builds the model

Step 3 · Store

Results go to Dragonfly for fast lookups, or to Milvus when they are vectors

Step 4 · Serve

An endpoint combines the stored model with the current user

Step 5 · Measure

Dashboards and experiments show whether the model helps

Hybrid recommendations

No single model is best everywhere. A hybrid recommendation combines two or more models, so that the strengths of one cover the weaknesses of another. Collaborative filtering is strong for people with history but blind to new items. Content-based filtering handles new items but cannot discover what similar users enjoy. Together they cover more situations.

Because endpoints are plain Python, you build a hybrid by calling several models in one endpoint and combining their output. PEACH does not prescribe how. These patterns are the common ones:

Pattern How it works Typical use
Fallback Use the main model; if it returns nothing or too little, fill the list from a second one Trending behind a personalised model, so a list is never empty
Weighted blend Score items with several models and merge the scores with weights Mix "people like you" with "similar to what you watched"
Switching Choose the model by situation Content-based for new users and new items, collaborative once there is history
Candidates, then re-rank One model proposes a broad set, another orders it Vector search proposes similar items, a personal model orders them. See Milvus hybrid search and reranking
Mixed list Take items from several models in turn, or in fixed slots A carousel with some personalised, some trending and some editorial items

Two things are specific to PEACH and help here:

  • Fallbacks are built in to the Recommendation API, so a model that has nothing to return hands over to another list.
  • Business rules apply editorial goals on top of the combined list, for example excluding items already seen or promoting a programme.

Test a hybrid like any other change: run it as a variant against the model it replaces with A/B testing, and compare click-through rate and diversity before you promote it.

Choosing a model

  • No information about the user? Start with trending.
  • Rich, reliable metadata and new content arriving all the time? Content-based filtering works from day one.
  • Lots of interaction history? Collaborative filtering finds patterns that metadata does not describe.
  • Lists feel repetitive? Try the diversified variant, or add business rules.
  • Different models are good in different situations. Combine them in a hybrid, and use trending as the fallback when another model has nothing to return.

Pitfalls to plan for

  • Cold start: new users and new items have no history. Fall back to trending or content-based filtering.
  • Sparse data: most users interact with a tiny part of the catalogue, so signals are noisy.
  • Popularity bias: models tend to favour what is already popular. Diversity and business rules counter this.
  • Feedback loops: what you recommend changes what people watch, which then becomes training data.
  • Drift: tastes and catalogues change, so retrain on a schedule and watch the metrics.
  • Privacy: train on what you need and respect consent. See user state and privacy.

Evaluate before you trust

Offline checks on held-out data tell you whether a model has learned something. Only a live comparison tells you whether it helps people.

PEACH has A/B testing built in. An experiment endpoint assigns each user, client or session to a variant, and every response carries a recommendation token so impressions and clicks can be traced back to the variant that produced them. Results appear in a dashboard with click-through rate and impact per variant, so you can compare models, parameters or layouts before you promote a change to production.

Next steps