/Collaborative-Filtering

Book Recommendation | Collaborative Filtering

Primary LanguageHTMLMIT LicenseMIT

Collaborative Filtering

A recommendation technique used in recommendation systems to provide personalized suggestions to users based on their past interactions and behaviors. It relies on the idea that users who have agreed on various items in the past are likely to agree again in the future.

Collaborative Filtering

Dependencies To install the required Python packages you can use the following command:
pip install -r requirements.txt
Datasets Reference This dataset has been compiled by Cai-Nicolas Ziegler in 2004, and it comprises of three tables for users, books, and ratings.

Explicit ratings are expressed on a scale from 1-10 (higher values denoting higher appreciation) and implicit rating is expressed by 0.

Collaborative Filtering Recommendation Model

Step 1: Collect Datasets

  • Books.csv: Information about books.
  • Users.csv: User data with user IDs.
  • Ratings.csv: User-book interaction data with user ratings.

Step 2: Data Preprocessing

  • Handle missing values, if any.
  • Ensure data consistency and accuracy.
  • Remove duplicates and irrelevant columns.

Step 3: Popularity-Based Recommendation

  • Calculate popularity scores for books

Step 4: Implement Collaborative Filtering Recommendation

  • Compute user similarities based on past interactions.
  • Identify similar users for each target user.
  • Recommend books based on similar users preferences using cosine vector similarity

Collaborative Filtering

Step 6: Demo Showcase

  • Showcase the collaborative filtering recommendation system demo in flask application
Run model.ipynb Generate all the binary pkl and csv files needed to run the demo showcase
Edit api.py [Optional for Search funtion]
  • Create an account at Algolia
  • Create your index and upload records of filtered 'BooksDataset.csv'
  • Find your API and edit on api.py

Collaborative Filtering

# Algolia API search

ALGOLIA_APP_ID = '____________'
ALGOLIA_API_KEY = '______________________'
ALGOLIA_INDEX_NAME = '_______________________'
Run app.py To run the app.py, load the dependecies requirements and use the following command:
py app.py

✨ Enjoy the demo


Feel free to send issues if you face any problem.
✨ Don't forget to star the repo :)