📚 Project Overview
This project implements a Book Recommendation System using a combination of:
- Popularity-Based Recommendations for suggesting the top 50 books based on aggregated ratings.
- Collaborative Filtering for personalized book recommendations tailored to individual users.
The system processes datasets containing books, users, and ratings to deliver meaningful recommendations. It is built with Python, employs cosine similarity for collaborative filtering, and is deployed as a web application using Flask.
- Popularity-Based Recommendations: Ranks books based on average rating and number of ratings to showcase the top 50 highly-rated books.
- Personalized Recommendations: Uses collaborative filtering to recommend books based on user preferences and similar users.
- Efficient Data Processing: Filters out invalid or sparse data to improve recommendation quality.
- Flask Web Application: Provides a user-friendly interface for browsing and receiving recommendations.
Collaborative filtering is a machine learning technique used for making recommendations by finding similarities between users or items. In this project, we use item-based collaborative filtering, which focuses on identifying books similar to a given book based on user ratings.
- Matrix Creation: A pivot table (
pt) is created where rows represent books, columns represent users, and values are ratings. - Similarity Computation: Cosine similarity is calculated between books to identify similar items.
- Recommendation Generation: For a given book, top similar books are ranked and suggested to the user.
The system utilizes three datasets:
-
Books Dataset (
Books.csv):
Contains book information, including title, author, year, publisher, and cover image URLs.- Example Columns:
ISBN,Book-Title,Book-Author,Year-Of-Publication,Publisher
- Example Columns:
-
Ratings Dataset (
Ratings.csv):
Holds user ratings for books.- Example Columns:
User-ID,ISBN,Book-Rating
- Example Columns:
-
Users Dataset (
Users.csv):
Stores demographic details of users.- Example Columns:
User-ID,Location,Age
- Example Columns:
Goal: Recommend the top 50 books based on ratings and popularity.
Steps:
- Aggregate the number of ratings and average ratings for each book.
- Filter books with a significant number of ratings (e.g., >250 ratings).
- Rank and display the top 50 books with their titles, authors, ratings, and cover images.
Goal: Generate personalized book recommendations.
Steps:
- User Filtering: Select users with more than 200 ratings to ensure meaningful interactions.
- Book Filtering: Retain books rated by at least 50 users for quality recommendations.
- Pivot Table: Create a user-book rating matrix (
pt). - Similarity Calculation: Compute cosine similarity between books.
- Recommendation: Find and display the most similar books for a selected book.
- The system is deployed as a Flask web app.
- Recommendations are generated dynamically and displayed with book images, authors, and ratings.
Programming Languages
- Python
Libraries
- pandas: Data manipulation
- numpy: Numerical computations
- scikit-learn: Cosine similarity
Web Framework
- Flask
Data Visualization
- Bootstrap: For UI design
Serialization - Pickle: For efficient deployment of models and data
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd book-recommender -
Install dependencies:
pip install -r requirements.txt
-
Run the Flask application:
python app.py
-
Open your browser and go to
http://127.0.0.1:5000.


