Asif EjazAI engineering / interactive demo← All demos
Three techniques. No model running at request time.

A recommender that shrank from 1.8 GB to 8.5 MB

This started as a client prototype that loaded three full similarity matrices on every request. Each item only ever needs its nearest ten neighbours, so that is all this version keeps. The answers are identical, the music catalogue is nineteen times larger, and a lookup takes about a millisecond.

81,206
songs, up from 4,350
8,807
films and shows
706
books rated by 810 heavy readers
100%
match with the original results
Try it

Pick anything and see what sits closest to it

Each catalogue uses a different technique. Every result says why it was matched, so you can judge the method and not just the list.

Loading a first example.
What changed

Same answers, one two hundredth of the weight

1.8 GB to 8.5 MB

Tables instead of matrices

A similarity matrix stores every pair, and 8,807 titles make 77 million pairs. The app only ever read the top few of each row. Keeping ten neighbours per item gives the same lists, checked against the original matrices on 400 random films, 400 random songs and all 706 books.

4,350 to 81,206

The whole music catalogue

The original music matrix covered a slice of the dataset. Neighbours are now computed in chunks, so the full matrix never has to exist in memory, and every distinct song is covered. Re releases of the same recording are folded into one entry.

Exact to typed

Search that forgives

The prototype needed the title typed exactly and failed on anything else. This one matches as you type across title and artist, ignores accents and punctuation, and ranks well known entries first.

Under the hood

Three catalogues, three different methods

Music

Audio features plus genre

Nine audio measurements per song (danceability, energy, loudness, valence and others) are scaled to the same range, genre flags are added with double weight, and songs are compared by cosine similarity. Genre keeps a jazz standard among jazz; the audio features decide which jazz.

Films and shows

Words that are rare elsewhere

Cast, director, genres, age rating and the plot description are merged into one text per title and weighted with TF IDF, which rewards words that are frequent in one title and rare across the catalogue. A shared director or lead actor counts for far more than a shared common word.

Books

Readers who rated both

Item to item collaborative filtering on the Book Crossing ratings. Only readers with more than 200 ratings and books with at least 50 ratings are kept, which leaves 706 books and 810 readers. Two books are close when the same readers scored them alike. Nothing about the text is used.

Limits

What this does not do

These are item to item lists, not personal recommendations: nothing here knows who you are. A similarity score is a distance in feature space, not a prediction that you will like the result. The catalogues are public datasets and stop where those stop: the film list is a 2021 Netflix snapshot and the book ratings date from 2004.