Coder Social home page Coder Social logo

recommendersystem's Introduction

Recommender system demo code

Installation

Before you use this demo, please make sure that you have Hadoop, Spark and Cassandra up and running. You can download both from the internet:

  • Spark: spark.apache.org
  • Hadoop: hadoop.apache.org
  • Cassandra: cassandra.apache.org

Quick start

After you have Spark, Hadoop and cassandra installed run the following scripts on the Cassandra server using CQLSH in order to get the database created and filled with sample data:

create keyspace recommendations with replication = { 'class': 'SimpleStrategy', 'replication_factor': 1 };
create table recommendations.user_item_rating (
    user_id int,
    item_id int,
    rating double,
    primary key(user_id, item_id)
);

After you created the database, create a CSV file with the following content: user_id, item_id, rating where each is an integer value. Load this new file into Cassandra using the command below:

copy user_item_rating (user_id, item_id, rating) from 'user_item_ratings.csv' with HEADER=true;

Next start the application using the follow command:

sbt run

Finally use CURL to train the first version of the recommender system model

curl -XPOST http://localhost:8080/train

Enjoy the show. You can get recommendations by opening http://localhost:8080/recommendations/[id] in a browser.

recommendersystem's People

Contributors

ikwattro avatar

Watchers

James Cloos avatar  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.