liveBook · Manning

Quality

As explained in AI Recommender Systems

The recommender-system stage that assigns predicted relevance or affinity scores to eligible candidate items.

Quality scoring assigns relevance or affinity signals to eligible candidate items. In a four-stage recommender, retrieval finds candidates, filtering removes ineligible items, scoring enriches those that remain, and ordering uses the scores alongside business logic to produce the final list. Scoring need not decide the final order by itself. section 1.4.1 section 2.2.8

A retrieval score can be a useful starting point without being enough to rank well. For movie candidates retrieved by similarity, a scoring pass can attach popularity calculated from each movie’s rating count divided by the largest count. The candidate then carries both similarity and popularity; further signals could include recency, genre preferences, or a model score. section 2.2.4

Listing 2.8 Adding popularity scores
def score_popularity(candidates):
    for item in candidates:
        item['popularity'] = popularity_scores.get(item['movie_id'], 0.0)
    return candidates
 
candidates = retrieve_similar_items(seed_movie_id, k=10)
candidates = filter_watched(candidates, test_user)
candidates = score_popularity(candidates)
 
print(f"Candidates with multiple scores:\n")
for item in candidates[:3]:
    title = movies[movies['movieId'] == item['movie_id']]['title'].values[0]
    print(f"{title}")
    print(f"  Similarity: {item['similarity']:.3f}")
    print(f"  Popularity: {item['popularity']:.3f}\n")
 

The scoring function iterates over filtered candidates, adds a popularity field, and retains the similarity score already supplied by retrieval. section 2.2.4

From scores to a recommendation

For an e-commerce “Customers also bought” row, retrieval finds frequently co-purchased products and filtering removes unavailable or previously purchased ones. Scoring estimates purchase probability for the user. Ordering can then introduce variety or boost higher-margin products. A strong item score is therefore an input to presentation, not the sole definition of a good final row. section 1.4.2

Keep scoring independently testable and replaceable. A pipeline can retain retrieval and filtering while swapping its scorer, or batch-score candidates without redesigning the other stages. Its quality also depends on upstream coverage: a scorer cannot reorder a relevant item that retrieval never supplied. If final precision falls, inspect retrieval, scoring, and filtering separately rather than assuming the scorer is at fault. section 2.2.8 section 4.6.5

Do not confuse a candidate’s scoring signal with an evaluation quality score. The former helps construct a recommendation; the latter measures the resulting recommendations and may need to account for relevance, position, novelty, or diversity. section 1.6 section 4.1.3

How AI Recommender Systems covers it

How deep it goes
Works through adding normalized popularity to similarity-scored movie candidates, while leaving further signals as extensions.
Examples
Uses movie similarity and rating-count popularity, plus predicted purchase probability for co-purchased products.
What it assumes
Assumes retrieved, filtered candidates with similarity scores; derives an additional signal from rating counts.
What you can do after
Build it from scratch by adding popularity scores to filtered candidates and passing the enriched candidates to ordering.
How it connects
Links candidate retrieval, filtering, popularity, collaborative filtering, ordering, and stage-level evaluation.

Also explained in

Compare how 10 books explain quality →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Recommender Systems. The section links point to the parts of the book it draws on.