Giter Site home page Giter Site logo

sparkr-naivebayes-example's Introduction

This is an example of using Spark MLlib's Naive Bayes model in R which I used as a demo at Singapore's Spark user group's first meetup http://www.meetup.com/Spark-Singapore/events/218794905/

Slides: http://www.slideshare.net/KienDang5/introduction-to-sparkr

Data source: https://archive.ics.uci.edu/ml/datasets/Spambase

Notes

Currently access to MLlib in SparkR is still in development. Thus use this method to run MLlib in R until MLlib is officially integrated into SparkR.

Setup

  1. Download SparkR:

     $ git clone https://github.com/amplab-extras/SparkR-pkg.git
    
  2. Add "org.apache.spark" % "spark-mllib_2.10" % "1.1.0", "org.scalanlp" % "breeze_2.10" % "0.10", "net.rforge" % "Rserve" % "0.6-8.1" to libraryDependencies in SparkR-pkg/pkg/src/build.sbt

  3. Copy src/RToScalaRDD.scala in this repo to SparkR-pkg/pkg/src/src

  4. Install SparkR:

     R
     devtools::install_local("path/to/SparkR-pkg/pkg")
    

Run example:

$ path/to/SparkR/sparkR
$ source("./R/1_naivebayes.R")
$ source("./R/2_spam_naivebayes.R")

sparkr-naivebayes-example's People

Contributors

kiendang avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

caiomsouza

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.