
For a reader of
The Cat in the Hat
Dr. Seuss, 1957 · 66 readers in the data
Machine learningBook recommender

For a reader of
Dr. Seuss, 1957 · 66 readers in the data
A blend of EASE, RP3beta and a text model, trained on every interaction with these books.
Or start from
A recommender’s job is to put in front of a reader the books they would want next, learned from what they and readers like them already have. Book-Crossing is the classic data for it: readers’ ratings of books from 1 to 10, and a 0 where a reader has a book without rating it.
I built one that learns from every book a reader has, rated or not, and tested it the way a recommender is used: hide some of each reader’s books and see whether its ten bring them back.
The data is a table of readers and books. Where a reader rated a book, the cell holds the rating, 1 to 10; where they have the book without rating it, a 0. 62.3% of Book-Crossing’s 1,149,780 interactions are a 0. Read as “no opinion”, they would be thrown away; read as “this reader has this book”, they are the signal a recommender wants, which readers keep which books together. That reading alone lifts EASE’s NDCG@10 from 0.108 on the ratings to 0.150 on every interaction.
So every model below learns from a table of 1s and blanks: a 1 where a reader has a book, rated or not. The ratings come back only in the test, to say which hidden books count.
The oldest way to recommend from such a table is item to item: two books are alike when the same readers have both. Count the readers of both and divide by the square root of each book’s readers, , the cosine, so that two books read by everyone don’t look alike only for that. A reader’s ten are then the books most like the ones they have. Tuned on ratings set aside, as every model here is, it does best keeping each book’s 5 most alike and adding 10 under the square root, so that two little-read books sharing a reader or two don’t look alike by chance. Learning from every interaction, it finds one of a reader’s hidden books for 42.2% of readers, against 16.8% for the most popular books.
EASE learns, for every book, how much each other book a reader has says about whether they have this one: one weight for every pair of books, fitted all at once in closed form, with nothing on the diagonal so a book can’t predict itself. With the table of readers and books, a 1 where a reader has a book:
A reader’s scores are , the sum of the weights from the books they have. keeps the weights small where two books share few readers; I chose it on ratings set aside from the test. On its own EASE finds a hidden book for 46.4% of readers, an NDCG@10 of 0.161.
A model this small is not a step back. When Ferrari Dacrema, Cremonesi and Jannach tried to reproduce eighteen neural recommenders, six of the seven they could reproduce lost to simple, tuned methods like these. So I tuned every model the same way and show each beside the most popular books and item-to-item filtering.
RP3beta walks: from a book to the readers who have it, from each of them to the other books they have, and counts where the walk lands. Left at that, a bestseller is where every walk lands. So each book’s count is divided by a power of its own readers, and a book’s own kind rises above the books everyone has. With the readers of book and the books of reader :
softens each step of the walk, is how hard a popular book is held back, and each book keeps its 1,000 strongest links. By shared readers alone, Divine Secrets of the Ya-Ya Sisterhood is in 77.6% of all the books’ lists; in the blend’s lists no single book is in more than 1.4% of them.
A book few readers have gives the first two models little to go on. The text model reads instead: each book’s title, author, subjects and description from Open Library, weighted by TF-IDF, and its 20 nearest books by those words. For the less-read half of the books, the 1,167 with fewer than 81 readers in training, it finds 12.6% of their held-back ratings, where EASE finds 8.8%.
The three models score a reader on scales of their own, so the blend turns each model’s scores for a reader into how far each book stands above that reader’s average, in standard deviations, and weighs the three: 0.2 for EASE, 0.7 for RP3beta and 0.1 for the words, the weights chosen on ratings set aside from the test.
For a shelf in your browser I keep one table instead: each book’s 50 strongest links to other books, each model’s part on the blend’s scale and weighted, so that a shelf’s score for a book is a plain sum of links from the shelf’s books:
is model ’s table of book-to-book weights and the spread of its row , the scale a reader of book alone is scored on. The links are stored as book ids in 16 bits and strengths in 8, 496 kB in all, loaded the first time a shelf has two books. Because the score is a sum, each recommendation can say exactly which of your books brought it, and how much of it. On the same test the table finds a hidden book for 47.9% of readers and the full blend for 48.2%: a difference of −0.3 points (95% interval −1.6 to +1.0), within the test’s reach.
For each of 2,271 readers a fifth of their ratings is hidden before any model sees the data. A model gets the rest and recommends ten books; it scores a hit when one of the ten is a hidden book the reader rated 4 or more. Every setting was chosen on ratings set aside for it, so the hidden ones were scored once, and each hit rate has its 95% interval.
A reader has a median of 3 such hidden books among 2,366, and ten guesses to find one. The blend finds one for 48 readers in 100.
Laid out by who reads them together, the 2,366 books fall into neighbourhoods: Dr. Seuss beside Dr. Seuss, Austen beside the Brontës. I made the map from the blend’s table: each pair’s link made the same both ways, squeezed to 48 numbers a book, then laid out flat by t-SNE, which keeps each book’s near neighbours near and lets the distance between two neighbourhoods mean little. Near on the map means read by the same readers, not alike in subject.
It agrees with the lists: of a book’s ten, 50% lie among its 50 nearest dots, and the rest are where two dimensions can’t hold everything a book is near.
97.6% of all the ratings given are 4 or more, so a hit means the ten found a book the reader had, not one they loved.
Four things the data showed, and what each changed in how the recommender is built.
Of the 1,149,780 interactions of 105,283 readers with books, 62.3% are a 0: the reader had the book and gave it no rating. Of the ratings given, 8 is the most common.
What it changed
The recommender reads a 0 as “this reader has this book”, which is what a recommender predicts. At the same settings, adding the tested readers’ other books, nearly all unrated, lifts EASE’s NDCG@10 from 0.108 to 0.137, and adding other readers’ books too, to 0.150.
Book-Crossing lists 271,360 editions. Of the 270,151 that anyone has, 53.9% have exactly one reader, and a model can’t learn what goes with a book only one person has. The 2,366 books here are the other end: 3.3% of the editions, with 25.8% of all interactions.
What it changed
It keeps the titles with at least 10 ratings from readers with at least 10, and learns from every reader a book has, rated or not: the median book has 81 readers to learn from, against 12 if only those ratings counted.
Wild Animus has 2,480 readers, 1.9 times the next book’s. Only 22.5% of them rated it, at 4.4 out of 10 on average, where the other most-read books average 7.5 to 9.0. Its publisher gave copies away through BookCrossing by the thousand, so having it says who received one, not who chose it.
What it changed
Models still learn from it, but it is never recommended: on readers alone it would top every list. The rule, more than 1,000 readers and a mean rating below 5, picks no other book.
Book-Crossing files each rating under an edition’s ISBN, with its title as typed. Told apart by exact title, editions with different titles are different books, different books with the same title are one, and HTML codes stay in the titles.
What it changed
The recommender compares titles loosely, checks the author, and joins the editions Open Library files as one work, like the three titles of The Hobbit. So 196 books join two or more titles, and 75 titles split between authors. The books’ editions go from the 5,160 ISBNs that match a title exactly to 8,884, so a reader of any edition counts.
2,508titles2,366books
| In the data | As a book |
|---|---|
| “Bel Canto” and “Bel Canto: A Novel” | One book, by Ann Patchett |
| “Lightning” | Two books, by Dean R. Koontz and by Danielle Steel |
| “Angels & Demons” | Angels & Demons |
Every model took the same test: readers with one of their held-back books in the ten, and NDCG@10, which also counts how high it sits.
The blend scores a hit for 48.2% of readers (95% interval 46.1–50.2%), item-to-item collaborative filtering for 42.2% (40.2–44.3%), and recommending the most popular books to everyone for 16.8%. The intervals don’t overlap: the gain is not luck in the test.
| Model | Readers with a hit | 95% interval | NDCG@10 | Books ever recommended |
|---|---|---|---|---|
| The most popular books, for everyone | 16.8% | 15.3–18.4% | 0.033 | 2.1% |
| Item-to-item collaborative filtering | 42.2% | 40.2–44.3% | 0.140 | 50.6% |
| EASE, on every interaction | 46.4% | 44.4–48.5% | 0.161 | 59.0% |
| The blend: EASE, RP3beta and a text model | 48.2% | 46.1–50.2% | 0.172 | 63.2% |
| The shelf’s table in your browser: each book’s 50 strongest links | 47.9% | 45.8–49.9% | 0.167 | 70.4% |
In Python, in stages, each answering one question under two rules: no held-back rating in training, and settings chosen only on ratings set aside for it.
1. Clean
Book-Crossing files a rating under an edition’s ISBN and its title as typed. Titles compared loosely, the author checked and editions joined as Open Library files them, its 2,508 most-rated titles are 2,366 books, each with its details and cover from Open Library.
2. Test
A fifth of each reader’s ratings held back, and a held-back book never in that reader’s training through any of its editions. Every setting chosen on ratings set aside for it, never on the test, and every hit rate with its 95% interval.
3. Model
Trained on every interaction, books readers have without rating them included, and tuned EASE, RP3beta and a text model on the ratings set aside. Their blend scores an NDCG@10 of 0.172.
4. Show
This page, with no server: one book’s ten are worked out ahead of time, and a shelf’s ten in your browser, from each book’s 50 strongest links in the same model.
It finds one of a reader’s own books for 48 readers in 100, against 42 for item-to-item collaborative filtering and 17 for the most popular books, and it spreads its lists across 63.2% of the books instead of returning the same few.
Much of the gain came from the data, not the model: reading a 0 as “this reader has this book” lifts EASE’s NDCG@10 from 0.108 on ratings alone to 0.150 (finding 1).
Test on time
Book-Crossing has no dates, so the held-back ratings are a random fifth of each reader's, not what they read next. With dated data I'd hold back each reader's latest books.
Ask readers
Held-back ratings reward finding books readers had already found. An A/B test on what people choose would show whether its less obvious picks are ones they want.
A program that puts in front of a reader the books they would want next, learned from what they and other readers already have. This one learned from 1,149,780 Book-Crossing interactions and, for 48 readers in 100, brings back one of their own hidden books in its ten. Try it at the top of the page with one book or a shelf of them.
It recommends from what readers have in common, not from what the books are about. Two books are alike when the same readers have both, and a reader is shown the books most like theirs. Item-to-item collaborative filtering finds a hidden book for 42.2% of readers here; EASE and RP3beta, which learn from the same table, do better (How it works).
Collaborative filtering learns from readers: who has what. Content-based filtering learns from the books themselves: their words, authors and subjects. The first is strong where many readers have a book, the second where few do; the blend here uses both, and on the less-read half of the books the text model finds 12.6% of the hidden ratings against EASE’s 8.8%.
What a person does rather than what they say: a book on their shelf, a film watched, a song played. Hu, Koren and Volinsky showed how to learn from it when ratings are few. In Book-Crossing 62.3% of the interactions are a book kept without a rating, and learning from them lifts EASE’s NDCG@10 from 0.108 to 0.150.
Neither publishes its whole system. Amazon described its own in 2003 as item-to-item collaborative filtering: for each product, the products bought with it, worked out ahead of time, which is what this page does for one book. Netflix’s public prize, from 2006 to 2009, made matrix factorization the best-known way to learn from a ratings table.
Put them on a shelf at the top of this page: search for a book, then add more. The ten are worked out in your browser from every book on the shelf, and each says which of yours it came from. The more books, the more the list reflects the shelf as a whole and not one book.
Here, three. The hit rate: the share of readers with one of their hidden books in the ten (48.2% for the blend). NDCG@10, which also counts how high the hit sits (0.172). And coverage, the share of all books that reach someone’s ten (63.2%), so a model can’t score well by naming the same bestsellers to everyone.
Ratings collected by Cai-Nicolas Ziegler in 2004 from Book-Crossing, a community whose members leave books for others to find: 1,149,780 interactions of 105,283 readers with books, each a rating from 1 to 10 or a 0 for a book kept without one. It is one of the standard sets for book recommenders; I use the 2,366 books with enough readers to learn from.
Embarrassingly Shallow Autoencoders, from Harald Steck in 2019: a model with one layer, one weight for every pair of items, fitted in closed form in a few lines of numpy. It is simple and hard to beat. Here it finds a hidden book for 46.4% of readers alone, and it is one of the blend’s three models.
Steck’s EASE in its own words: the whole model as one equation and a few lines of numpy, tested on three data sets.
Why simple, tuned baselines belong beside any recommender: most neural methods it could reproduce lost to them.
A thousand TV shows laid out by who watches them together, with what you watched and what is recommended on one picture.
A survey of how a recommendation can explain itself, and why tying it to the person’s own items works best.
The plainest introduction: users and items in one space, first on one axis, then on two.
The paper that introduced the Book-Crossing data, and why a list of ten should not be ten of one kind.
Thousands of items, Goodbooks-10k among them, laid out in the browser by who likes them together.
A whole catalog in, recommendations out, in 2006, and the “why” button it wished for: “Suggested because you own …”.
Ratings: the Book-Crossing data (Cai-Nicolas Ziegler, 2004), from Kaggle’s Book Recommendation Dataset. Book details, descriptions and covers: Open Library (opens in a new tab).
Each list shows one edition of a book, and none includes Wild Animus (finding 3 above).