Giter Site home page Giter Site logo

movies4j's Introduction

Movies4j - Movie Recommendation Engine

Movies4j is an example application for the usage of Graph Databases, specifically of Neo4j. It is targeted at beginners who want to learn about the benefits of Graph Databases and their use cases. It shows the simplicity of the Neo4j and the Cypher Query Language. If you are interested, learn more about them on neo4j.com.

The application allows users to rate movies they like and add other users as their friends. Based on this information, users will receive recommendations for other movies, they might like as well and movies that their friends like.

Screenshot

Architecture

Installation

  • Download Neo4j Community Edition from http://neo4j.com/ (Manual)
  • Unzip the contents of db/graph.db.zip to neo-install-dir/data/graph.db
  • Start Neo4j ./bin/neo4j start
  • Open your browser at http://localhost:7474, login with neo4j/neo4j and change the password to neo5j (feel free to use a different password, but then you need to change the connection url in config.js accordingly)
  • Run npm install in the repo's main directory
  • Run npm start to start the server
  • Open your browser at http://localhost:8000

##Algorithms Probably one of the most interesting parts of the application are the algorithms that are used to determine recommendations. You can have a look at them in models/user.js (getSimilarMovies and getFriendsMovies are the important methods).

###Similar Movies

MATCH (me:User)-[r1:RATED]->(m:Movie)<-[r2:RATED]-(u:User)-[r3:RATED]->(m2:Movie)
WHERE ID(me) = {userid} AND r1.stars > 3 AND r2.stars > 3 AND r3.stars > 3 AND NOT (me)-[:RATED]->(m2)
RETURN distinct m2 AS movie, count(*) AS count
ORDER BY count DESC
LIMIT 10

Explanation: Look for users who rated movies with three or more stars, that I have rated high as well. Which movies did these users liked additionally and I haven't seen yet?

###Friends Movies

MATCH (me:User)-[:FRIEND]-(f), (f)-[r:RATED]-(m:Movie)
WHERE ID(me) = {userid} AND r.stars > 3 AND NOT (me)-[:RATED]->(m)
RETURN distinct m AS movie, count(*) AS count
ORDER BY count DESC
LIMIT 10

Explanation: From all of my friends, which movies did they rated high and I haven't seen yet?

movies4j's People

Contributors

citruz 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.