ML-Based-Book-Recommender-System

Project: ML Based Book Recommender System ! | Collaborative Filtering Based

workflow

Recommendation systems are becoming increasingly important in today’s extremely busy world. People are always short on time with the myriad tasks they need to accomplish in the limited 24 hours. Therefore, the recommendation systems are important as they help them make the right choices, without having to expend their cognitive resources.

The purpose of a recommendation system basically is to search for content that would be interesting to an individual. Moreover, it involves a number of factors to create personalised lists of useful and interesting content specific to each user/individual. Recommendation systems are Artificial Intelligence based algorithms that skim through all possible options and create a customized list of items that are interesting and relevant to an individual. These results are based on their profile, search/browsing history, what other people with similar traits/demographics are watching, and how likely are you to watch those movies. This is achieved through predictive modeling and heuristics with the data available.

Note:

If you want to understand this entire project overflow, please refer the jupyter notebook file inside notebook folder.

Types of Recommendation System :

1 ) Content Based :

2 ) Collaborative Based :

3 ) Hybrid Based :

About this project:

This is a collaborative filtering based books recommender system & a streamlit web application that can recommend various kinds of similar books based on an user interest.

Demo:

workflow

workflow

Dataset has been used:

Concept used to build the model.pkl file : NearestNeighbors

1 . Load the data

2 . Initialise the value of k

3 . For getting the predicted class, iterate from 1 to total number of training data points

4 . Calculate the distance between test data and each row of training data. Here we will use Euclidean distance as our distance metric since it’s the most popular method.

5 . Sort the calculated distances in ascending order based on distance values

6 . Get top k rows from the sorted array

Built With

  1. streamlit
  2. Machine learning
  3. sklearn

How to run?

STEPS:

Clone the repository

https://github.com/entbappy/ML-Based-Book-Recommender-System.git

STEP 01- Create a conda environment after opening the repository

conda create -n books python=3.7.10 -y
conda activate books

STEP 02- install the requirements

pip install -r requirements.txt

Now run,

streamlit run app.py
Note: Before clicking on show recommendations first of all click on Train Recommender System for generating models

How to run in Docker?

Build a Docker image

The docker build command builds an image from a Dockerfile . Run the following command from the app/ directory on your server to build the image:

docker build -t streamlit .

The -t flag is used to tag the image. Here, we have tagged the image streamlit. If you run:

docker images

You should see a streamlit image under the REPOSITORY column. For example:

REPOSITORY   TAG       IMAGE ID       CREATED              SIZE
streamlit    latest    70b0759a094d   About a minute ago   1.02GB

Run the Docker container

Now that you have built the image, you can run the container by executing:

docker run -p 8501:8501 streamlit

The -p flag publishes the container’s port 8501 to your server’s 8501 port.

If all went well, you should see an output similar to the following:

$ docker run -p 8501:8501 streamlit

  You can now view your Streamlit app in your browser.

  URL: http://127.0.0.1:8501/

To view your app, users can browse to http://0.0.0.0:8501 or http://127.0.0.1:8501/