Giter Club home page Giter Club logo

movie_recommendation's Introduction

Movie Recommendation

Install

With docker-compose

Since you already have Docker and docker-compose installed, there's just one step:

docker-compose up -d

With python virtual environment

Activate python virtual envirnonment and install the requirements

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Preprocess the data set, actually we just clean the missing values data and create a column with the features we will use

(venv) python preprocess.py

Create the model

(venv) python recommendation.py

The two previous steps we run once. The results are the data set preprocessed movies_pos.csv and the pickle binary cosine.pkl with the cosine simirality array already trained on the dataset, we will use both in the api.py. We only will need to run these two steps again if we change the data set, or change the preprocess steps, or the model parameters.

Run the fastapi server

uvicorn api:app --reload

Usage

Access the application on: http://127.0.0.1:8000

Access the API documentation on : http://127.0.0.1:8000/docs or http://127.0.0.1:8000/redoc

Make request using a browser, the docs pages or any other API request application

Examples using curl:

Search for the Interstellar movie

curl -X GET "http://127.0.0.1:8000/movies/?q=Interstellar" -H  "accept: application/json"

Get the details of Interstellar by its ID

curl -X GET "http://127.0.0.1:8000/movies/93" -H  "accept: application/json"

Get a list of Interstellar similar movies

curl -X GET "http://127.0.0.1:8000/movies/93/recommendation" -H  "accept: application/json"

movie_recommendation's People

Contributors

thalesbruno avatar dependabot[bot] 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.