Code Monkey home page Code Monkey logo

movie-recommendation-app's Introduction

movie-recommendation-app

This is a final project of EN.601.429/629 Functional Programming in Software Engineering in Fall 2022.

Overview

An Interactive command-line application built in OCaml for movie recommendation. Use three modes based on the three types of recommendation systems to generate the recommendation list:

  • Demographic Mode

    It offers generalized recommendations to every user based on movie popularity, which can be treated as a top list among all movies in our movie library. Users don’t need to input their movie preference list, and every user will get the same ordered list.

  • Content Based Mode

    It provides similar movies. First genreate TF-IDF vector for feature overview, and counter vector for features keywords, genres, casts, and director, and then combine these two vectors to calculate cosine similarity for movie pairs. Users need to input their movie preference list, and will get a similar recommended movie list.

  • Collaborative Mode

    It provides recommendations based on the rating data. Use biasSVD to predict rating for movies. Users need to input a rating list which contains the movie and corresponding rates.

Build and run the project

  1. Install python library sklearn (See the official instructions)

    $pip3 install -U scikit-learn
  2. Ensure that csv , yojson, owl, sklearn , inquire , ppx_deriving, ounit2, bisect_ppx and its dependencies are installed by running:

    $opam install csv yojson owl sklearn inquire ppx_deriving ounit2 bisect_ppx
  3. Build project in the project directory, it will generate an executable file main.exe

    $dune build

    Then run the program with the following command

    $./_build/default/src/main.exe

    Or directly use the following command to build and run the program

    $dune exec ./src/main.exe

Modules

  • movie.ml - The movie data related data type Movie.t and functions
  • rating.ml - The rating data related data type Rating.t
  • data_preprocessing.ml - Parse csv file and load data, call load_movie_data (credits_filename) (movie_filename) to load movie dataset and load_rating_data (rating_filename) to load rating dataset
  • utils - Common used functions
  • demographic_mode.ml - Main logic of demographic mode, call get_recommendations (movie_list:Movie.t) (n:int) to get recommended movie list
  • content_based_mode.ml - Main logic of demographic mode, call get_recommendations ~(title:string) ~(n:int) ~(movie_list:Movie.t) to get recommended movie list
  • collaborative_mode.ml - Main logic of collaborative mode, call get_recommendations ~(movie_list:Movie.t) ~(rating_list:Rating.t) ~(ur_list:Rating.t) ~(n:int) to get recommended movie list
  • main.ml - Main logic for interactive commend line interface

References

movie-recommendation-app's People

Contributors

rongyangrosie avatar helenlin305 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.