Built to order

Book Recommendation using Hybrid Filtering

A book recommender with two brains instead of one. It blends user-based collaborative filtering ("readers like you also loved") with content similarity over genres and reader shelf-tags, as lambda x CF + (1-lambda) x content. Built on Goodbooks-10k (10,000 books, 6M ratings), lambda is chosen by a validation sweep maximizing nDCG@10 — not guessed. The demo compares Hybrid vs CF-only vs Content-only rankings and has a live lambda slider that re-ranks instantly. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and Data Science.

Book Recommendation using Hybrid Filtering — project thumbnail preview
More project photos (3)

The problem

Production recommenders are rarely pure collaborative filtering or pure content-based — they are hybrids, because each pure method has a blind spot the other covers. CF is strong where ratings are dense but helpless for a new user with two ratings; content-based methods survive cold start but can only recommend more-of-the-same and never surprise. Students typically implement the two as separate assignments and never see them combined: how two scores on different scales are normalized, how the blend weight is chosen by validation instead of gut feel, and how the system degrades gracefully when one signal is missing. The Goodbooks-10k corpus — 10,000 books, 6M ratings from 53,424 readers, plus genre and shelf-tag metadata — is the standard public book-rating dataset. This project builds both signals on it, sweeps the blend weight on a validation split, and ships a demo where lambda is a live slider, so the hybrid stops being an equation and becomes something you can feel.

SYSTEM FLOW

7 components 8 connections

Live flow
Drag to explore
100%
userUser

The reader rates a few books and moves the lambda slider.

Follow the working sequence

How it works

  1. Goodbooks-10k ratings.csv (1-5 stars), books.csv metadata and book_tags.csv shelf tags are joined; a train/validation/test split is fixed by seed.
  2. The CF signal: user-based kNN with cosine similarity over mean-centered ratings predicts scores for books the user has not rated.
  3. The content signal: TF-IDF over genres + top shelf tags, cosine similarity against the user's highly-rated books, averaged into one score per candidate.
  4. Both signals are min-max normalized per user onto [0,1] and blended with lambda; the validation sweep picks the lambda maximizing nDCG@10 (expected near 0.6).
  5. At serving time the demo computes both scores for candidates, blends at the current lambda, and renders the top 5 with per-signal contribution bars.
  6. The evaluation notebook reports RMSE, Precision@10, nDCG@10 and catalog coverage for CF-only, content-only and hybrid side by side.

Tech stack:

  • Python 3.10, scikit-surprise / scikit-learn (user-based kNN)
  • scikit-learn TfidfVectorizer (genre + shelf-tag content vectors)
  • pandas, NumPy (joins, normalization, lambda sweep)
  • Matplotlib (lambda-sweep curve, metric comparison charts)
  • Flask demo app (rating, comparison, blend-tuner and evaluation views)
  • Goodbooks-10k dataset (10,000 books, 6M ratings, 53,424 users)
Parameter Value
Architecture Weighted hybrid: lambda x CF + (1-lambda) x content, per-user min-max normalized
CF signal User-based kNN, cosine similarity on mean-centered ratings
Content signal TF-IDF over genres + user shelf tags, cosine vs highly-rated books
Dataset Goodbooks-10k: 10,000 books, 6M ratings (1-5), 53,424 users, shelf-tag metadata
Lambda selection Sweep over [0,1] on validation maximizing nDCG@10 (expected near 0.6)
Evaluation RMSE, Precision@10, nDCG@10, catalog coverage for all three methods — computed by the notebook during your build
Design targets Hybrid approximately nDCG@10 ~0.57, P@10 ~0.44 (final numbers from your own run)
Cold start <3 ratings: lambda forced toward 0 (content leads); new books scored by metadata until rated
Input Star ratings on known books + lambda slider
Output Ranked books with blended score and per-signal contribution bars

Project features

  • [User-based kNN collaborative signal] Cosine similarity over mean-centered Goodbooks-10k ratings finds nearest-neighbor readers and predicts scores for unseen books.
  • [TF-IDF content signal] Genres plus top user shelf-tags per book become TF-IDF vectors; similarity to the user's highly-rated books gives the content score.
  • [Validated lambda blend] Both signals are min-max normalized per user and combined as lambda x CF + (1-lambda) x content, with lambda swept in [0,1] on validation maximizing nDCG@10.
  • [Live blend tuner] The demo binds lambda to a slider that re-ranks the top 5 instantly, showing how low lambda favors safe genre matches and high lambda favors crowd wisdom.
  • [Three-way method comparison] Flip between Hybrid, CF-only and Content-only rankings to see exactly what each signal contributes — and what each loses alone.
  • [Per-signal contribution bars] Every hybrid recommendation shows its CF and content component scores, so the blend is auditable, not magic.
  • [Cold-start fallback rules] With fewer than 3 ratings lambda is forced toward 0 (content leads); the demo's evaluation view documents the fallback ladder explicitly.

What is included

  • Complete source code (kNN CF, TF-IDF content model, normalization, lambda sweep, Flask demo)
  • Jupyter notebooks (buyer-run procedure: train both signals, sweep lambda, evaluate three-way)
  • Evaluation outputs: lambda-sweep curve and metric comparison tables from your build
  • Project report PDF (background, hybrid architectures, methodology, evaluation, cold-start analysis)
  • PPT presentation for final review
  • Viva Q&A preparation document (kNN, TF-IDF, score normalization, nDCG, hybrid design)
  • Setup guide (environment, Goodbooks-10k download, running notebooks and demo)

Advantages

  • Two signals instead of one: user-based collaborative filtering combined with TF-IDF content similarity over genres and reader shelf-tags.
  • The blend weight lambda is chosen by a validation sweep maximizing nDCG@10, not guessed.
  • The live lambda slider re-ranks the top 5 instantly, showing how low lambda favors safe genre matches and high lambda favors crowd wisdom.
  • The three-way comparison (Hybrid vs CF-only vs Content-only) shows exactly what each signal contributes — and what each loses alone.
  • Per-signal contribution bars show each recommendation's CF and content component scores, so the blend is auditable, not magic.
  • Cold-start fallback rules force lambda toward 0 when a user has fewer than 3 ratings, so content leads for new readers.

Disadvantages

  • The CF side still needs ratings: with zero history the system is effectively content-only, as the fallback ladder states openly.
  • Shelf tags are noisy user folksonomy ("to-read", "favorites") — the content signal inherits that noise.
  • Popularity bias persists in the CF component; blockbusters dominate until re-ranking is added.
  • A single global lambda is a simplification — the optimal blend varies per user, and per-user lambda learning is future scope.
  • Offline metrics come from held-out ratings; whether readers actually enjoy the blended lists needs online testing beyond a student build.

Limitations & prerequisites

  • The CF side still needs ratings: with zero history the system is effectively content-only, and the report's fallback ladder states this openly.
  • Shelf tags are noisy user folksonomy ("to-read", "favorites") — the content signal inherits that noise, documented in the report.
  • Popularity bias persists in the CF component; blockbusters dominate until re-ranking (future scope) is added.
  • A single global lambda is a simplification — the optimal blend varies per user, and per-user lambda learning is listed as future scope.
  • Offline metrics come from held-out ratings; whether readers actually enjoy the blended lists needs online testing beyond a student build.

Frequently Asked Questions

Which dataset is used?

Goodbooks-10k: 10,000 books with 6M ratings (1-5 stars) from 53,424 users, plus book metadata (author, year, average rating) and user-assigned shelf tags/genres in book_tags.csv — ratings, content features and tags all in one corpus.

How are two different scores combined fairly?

Both signals are min-max normalized per user onto [0,1] before blending, so neither dominates by scale. The blend lambda x CF + (1-lambda) x content is then swept over [0,1] on the validation split, picking the lambda that maximizes nDCG@10.

Are the metric numbers guaranteed?

No. Design targets are approximately nDCG@10 ~0.57 and Precision@10 ~0.44 for the hybrid; the notebook computes RMSE, P@10, nDCG@10 and coverage for CF-only, content-only and hybrid on your build, and the report presents your measured numbers.

What happens with a brand-new user?

The cold-start ladder: with fewer than 3 ratings lambda is forced toward 0, so content similarity leads and the system recommends from the genres of browsed/rated books; as ratings accumulate, lambda rises toward the validated optimum.

Why not just use matrix factorization instead of kNN?

kNN keeps the CF signal explainable ("readers like you") and trains fast on 6M ratings without a GPU — ideal for a viva. The report lists SVD/ALS as the natural scale-up in future scope.

Can the content side use review text?

Yes — the TF-IDF pipeline accepts any text field, and review-text sentiment via BERT embeddings is documented as a future-scope third signal. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and Data Science.

Components & software requirements
  • Python 3.10, scikit-surprise / scikit-learn (user-based kNN)
  • scikit-learn TfidfVectorizer (genre + shelf-tag content vectors)
  • pandas, NumPy (joins, normalization, lambda sweep)
  • Matplotlib (lambda-sweep curve, metric comparison charts)
  • Flask demo app (rating, comparison, blend-tuner and evaluation views)
  • Goodbooks-10k dataset (10,000 books, 6M ratings, 53,424 users)
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Burke — Hybrid Recommender Systems: Survey and Experiments, UMUAI 2002

Get a quotation