Unbound is a content-based & collaborative filtering book recommendation system built with Python (Flask) for the backend and a lightweight HTML/CSS/JavaScript frontend.
It suggests books based on user-selected titles using K-Nearest Neighbors (KNN) on a sparse ratings matrix.
- Real-time book search with autocomplete suggestions
- Personalized recommendations using collaborative filtering
- Data preprocessing & filtering for cleaner results
- Responsive frontend for smooth user experience
- Architecture page with dataset & filtering insights
We use the Book-Crossing dataset which contains:
- Books metadata (
BX-Books.csv) - User information (
BX-Users.csv) - Ratings data (
BX-Book-Ratings.csv)
To ensure high-quality recommendations, the dataset is filtered in two stages:
| Step | Filter Condition | Reason | Before | After |
|---|---|---|---|---|
| 1 | Users with > 200 ratings | Keep only active readers with enough preference data | 105,283 | 899 |
| 2 | Books with ≥ 50 ratings | Keep only popular books for reliable similarity | 160,269 | 742 |
Note: These thresholds remove sparse and noisy data, improving recommendation accuracy.
- Load & Clean Data – from CSVs (books, users, ratings)
- Filter Users & Books – remove low-activity users & low-rated books
- Create Pivot Table – books × users with ratings
- Convert to Sparse Matrix – for efficiency
- Train KNN Model – cosine similarity for nearest neighbors
- Save Model & Data – serialized with
pickle - Serve via Flask – API for
/suggest&/recommend - Frontend UI – search & view recommendations
- Backend: Python, Flask
- ML: pandas, scikit-learn, SciPy
- Frontend: HTML, CSS, JavaScript
- Data: Book-Crossing dataset
git clone https://github.com/yashjainme/book-recommendation-system.git
cd book-recommendation-systempip install -r requirements.txtpython train.pypython app.py