GithubHelp home page GithubHelp logo

imtej / recommendation-system-for-books Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 40.89 MB

Recommendation System for Books using Collaborative Filterings: An ML Project to Recommend 'n' similar Books for a given book, as per the Collaborative users' ratings of the books. This Project also involves the deployment in a Flask Based web application.

Home Page: https://recommendation-system-for-books.onrender.com/

Python 0.95% Jupyter Notebook 97.19% HTML 1.86%
collaborative-filtering flask flask-application machine-learning ml ml-engineering mlops recomendation-algorithm recommendation recommendation-system

recommendation-system-for-books's Introduction

End-to-End Recommendation System Project

Recommendation System for Books (Using Collaborative Filtering)

Introduction About the Data :

Book Recommendation Kaggle dataset: In a very general way, recommender systems are algorithms aimed at suggesting relevant items to users (items being movies to watch, text to read, products to buy or anything else depending on industries).

Content:

The Book-Crossing dataset comprises 3 files.

Users:

Contains the users. Note that user IDs (User-ID) have been anonymized and map to integers. Demographic data is provided (Location, Age) if available. Otherwise, these fields contain NULL-values.

Books:

Books are identified by their respective ISBN. Invalid ISBNs have already been removed from the dataset. Moreover, some content-based information is given (Book-Title, Book-Author, Year-Of-Publication, Publisher), obtained from Amazon Web Services. Note that in the case of several authors, only the first is provided. URLs linking to cover images are also given, appearing in three different flavours (Image-URL-S, Image-URL-M, Image-URL-L), i.e., small, medium, and large. These URLs point to the Amazon website.

Ratings:

Contains the book rating information. Ratings (Book-Rating) are either explicit, expressed on a scale from 1-10 (higher values denoting higher appreciation), or implicit, expressed by 0.

Kaggle Dataset Source Link: [https://www.kaggle.com/datasets/arashnic/book-recommendation-dataset?resource=download]

Project Objective

  • Build and deploy an ML Model (Recommendation System using Collaborative Filtering) which takes a book name as input and recommends similar books as per the collaborative ratings of the users. Along with that it also shows the most popular top 50 books as per the ratings of the users.

Approach for the project

Data Ingestion

Loading the Data: Every csv dataset books, Users, and Ratings are loaded into pandas DataFrames.

Data Transformation

  • Data Preparation:

    • Cleaning the data
    • Handling missing values
    • Handling Categorical features
    • Feature engineering

Model Building

  • Generated new Features like num_ratings, avg_ratings after merging the relevant dataframes to find the insights. (eg: popular_df have the top 50 most popular Books as per the ratings of the users.)
  • Vectorization of user-book interactions: Vectorization of Books having Users' ratings as the elements of the vector in higher dimensional space. (No. of relevant users = Dimensionality of space, No. of relevant Books = No. of vectors (points) in that higher dimensional space.)
  • Made the pandas pivot table for the vectorization.
  • Employed collaborative filtering technique as cosine similarities amongst the books to find the recommendation of similar books as per the collaborative ratings of the users.
  • Defined and implemented the recommend function which takes input as Book Title and follows the considerations of collaborative filterings into the account to give the recommendations of similar Books.

Model Saving

  • stored (serialized) the relevant dataframes and models by dumping them in the pickle format to load in app.py(eg: books.pkl, popular.pkl, pivot_table.pkl, similarity_scores.pkl).

Flask App creation :

  • Made Flask app using HTML (for css, implemented Bootstrap inside the HTML file) with two pages (index.html and recommend.html) as a UI inside a Web Application.

Deployment of Flask application on Render:

Screenshots of UI

Homepage

HomepageUI

Recommend Page

  • 1

RecommendUI

  • 2

RecommendUI

  • 3

RecommendUI

File Structure

  • app.py: The main Flask application file.
  • model_files_as_pickle/: Directory containing the pickled model files.
  • templates/: HTML templates for rendering the web pages.
    • index.html: Homepage displaying the most popular books.
    • recommend.html: Page for entering a book name and displaying recommendations.
  • requirements.txt: A list of Python dependencies required to run the project.

recommendation-system-for-books's People

Contributors

imtej avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.