Code Monkey home page Code Monkey logo

spark-cassandra-collabfiltering's Introduction

spark-cassandra-collabfiltering

Illustrates:

  • Collaborative filtering with MLLib on Spark
  • The same Spark client code written in Java 7 and Java 8, showing the new Java 8 features that make Spark's functional style much easier
  • Cassandra providing the data to Spark
  • A synthesized training/validation set of employee ratings for companies

To setup (tested on Ubuntu 14.04):

  • Install JDK Java8. sudo apt-get install oracle-java8-installer
  • Get Spark.
    • Download 1.1.0 for Hadoop 2.4. We will not be using Hadoop even though this build supports it.
    • Untar the spark tarball. (E.g., in ~/dev)
    • Test the installation with ./bin/run-example SparkPi
  • See QuickStart in below for more instructions and tutorials on setup.

Get Eclipse:

  • Download Eclipse Luna 4.4.1 Ubuntu 64 Bit (or 32 Bit) from Eclipse.org. Only the latest Eclipse supports Java 8.
  • Untar, run Eclipse.
  • Set your Java 8 JDK as the default JDK.
  • Install Maven2 Eclipse,
    • Menu Help -> Install New Software…
    • Add this repository
    • Check Maven Integration for Eclipse, then install.

Project

  • Right-click on pom.xml, choose Maven-> install.
  • This will now download Spark jars; it will take a while.
  • It will also set your Eclipse project's source level to Java 8.

Dataset

  • ratings.csv is generated from ratings.ods, which is a spreadsheet for synthesizing data sets to test and fine tune your model.
  • Adjust ratings.ods and save as CSV. See readme.txt in data directory for instructions.

Cassandra

  • Instructions for getting Cassandra: here
  • Run Cassandra: sudo /usr/bin/cassandra
  • We will be runnning Cassandra and Spark locally with console, rather than remotely in a cluster as daemon/service.
  • Create schema by running attached SQL as follows:
    • In workspace root, run cqlsh -f ./collabfilter/src/sql/collab_filter_schema.sql

Running tests:

  • Run collabfilter.CollabFilterCassandraDriver.main or the CollabFilterTest unit test.

More references:

spark-cassandra-collabfiltering's People

Contributors

joshuafox avatar

Watchers

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