Skip to Content
Building Recommendation Systems in Python and JAX
book

Building Recommendation Systems in Python and JAX

by Bryan Bischof, Hector Yee
December 2023
Intermediate to advanced content levelIntermediate to advanced
338 pages
8h 57m
English
O'Reilly Media, Inc.
Content preview from Building Recommendation Systems in Python and JAX

Part IV. Serving

Well, you can’t recommend that! Why sometimes the best recommendations aren’t right.

One of the authors, Bryan, has a big question for the Amazon recommendation team: “Exactly how many vacuum cleaners do you think I need?” Just because Bryan bought the fancy Dyson to clean up after his dog doesn’t mean he’s soon going to buy a second one, and yet his Amazon home page seems hell-bent on recommending it. The reality is you’ll always need to include business logic—or basic human logic—that you want to include in the flow of your recommendation system to prevent silliness. Whether you’re facing contextually inappropriate recommendations, business infeasible recommendations, or simply the necessity to keep the set of recommendations a bit less monomaniacal, the last-step ordering can crucially improve recommendations.

But hold your horses! Don’t think the ordering step is all switch cases and manually overriding your recommendation system. A synergy needs to exist between your ranking and your serving. Bryan also has a story about a certain query-based recommender he built for clothes: he wanted to implement a super-simple diversity filter on his recommendations—checking that the clothes recommended were of different merchandise classes. He made the output of his scoring model stack-rank the recommendations by merchandise class, so he could pick a few from each to serve. Lo and behold, the first week in production he was recommended 3, 4, even 5 backpacks out of 10 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Testing with pytest

Python Testing with pytest

Brian Okken
Introduction to Python

Introduction to Python

Jessica McKellar

Publisher Resources

ISBN: 9781492097983Errata PageSupplemental Content