Git Product home page Git Product logo

movielen_recsys's Introduction

Movielen (small) Recsys

Built With

  • FastAPI (serve)
  • Surprise-ScikitLearn (model)
  • pytest (test)

How do I get set up?

  • on local machine (train, serve, load test)
    make setup
    
  • on docker
    make docker_build
    

Usage

How does it work

  • Model

    • user based collabortation filtering with SVD
  • Serve Code Structure

    • main.py
      • this module is wrap recommender and serve as RestAPI by FastAPI
    • modules/db.py
      • this module is use for query movielen data
      • now it just load movielen data as dataframe
    • modules/feature_store.py
      • this module is use for query feature to use for model prediction
      • now return features are "histories" (watched movie id) and "unwatched_movie_ids"
      • now it just query from DB, but in future if model is more complex we can get benefit from this module
    • modules/recommender.py
      • this module is wrap model to use for recommend data from user_id
      • given user_id and use SVD model to predict rating of unwatch movies
      • then get top 10 movie and return to user
  • Research Phase (train)

    • clean data
      • use pandasprofiling to see static of data
      • merge movie in movie_df that have duplicate title
      • remove rating data that have rating outside range[0, 5] and user_id is Nan
    • train model
      • user surprise lib to train SVD model
      • get RMSE of algorithm on train test data split
      • get Hitrate (precision) of this algorithm on leave one out data split
      • get final model by use all data as trainset (to memory it)
      • save artifacts

How to feed input and get output

  • by Swagger UI
  • by API
    • you can call API follow specification by your prefer tools ex. curl, python requests, postman

Input & Output Example

  • see in folder images

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.