Skip to content

ajay-nikumbh/Movie-Recommendation-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Movie-Recommendation-System

image aja

A. Content Based Filtering

  1. They suggest similar items based on a particular item.
  2. This system uses item metadata, such as genre, director, description, actors, etc.
  3. For movies, to make these recommendations.
  4. The general idea behind these recommender systems is that if a person liked a particular item he or she will also like an item that is similar to it.

B. Collaborative Filtering

  1. This system matches persons with similar interests and provides recommendations based on this matching.
  2. Collaborative filters do not require item metadata like its content-based counterparts.

1. Project Overview

A. Data collection : Tmdb 5000 dataset

image

B. Data set after cleaning text

image

C. Recommend function

Cosine similarity

3

def recommend(movie):
    
    # Fetch the index
    movie_index= new_df[new_df['title'] == movie].index[0]
    
    # Fetch the distances
    distances = similarity[movie_index]
    
    # Get the 5 similar movies 
    movies_list= sorted(list(enumerate(distances)),reverse=True,key=lambda x:x[1])[1:6]
    
    # Now print the first indexe's of the top 5 similar movies
    for i in movies_list:
        print(new_df.iloc[i[0]].title)

2. Streamlit Ui

image image image

3. Deploying a Streamlit app to Heroku

  1. Folder structure

image

  1. setup.sh file

‘setup.sh’ specifies the commands to be executed to configure the environment before running the app. In our ‘setup.sh’, we first create a ‘.streamlit’ directory to store the credentials and config files. Then, we specify the e-mail registered with streamlit.io and write it to a ‘credentials.toml’ file. Then, we add the config details to the ‘config.toml’ file. Both these files reside in the ‘.streamlit’ directory.

mkdir -p ~/.streamlit/

echo "\
[general]\n\
email = \"email@domain\"\n\
" > ~/.streamlit/credentials.toml

echo "\
[server]\n\
headless = true\n\
enableCORS=false\n\
port = $PORT\n\
" > ~/.streamlit/config.toml
  1. Procfile

‘Procfile’ lists the commands to be executed to start the app. In our ‘Procfile’, we’ll first run ‘setup.sh’ that creates the required config files. Then run the app using the ‘streamlit run’ command.

web: sh setup.sh && streamlit run app.py
  1. Heroku commands
$ heroku login
$ git init
$ heroku git:remote -a mrs-ajay
$ git add .
$ git commit -am "movies recommender"
$ git push heroku master

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages