github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

danielsdeleo / Decider

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 37
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Flexible and Extensible Machine Learning in Ruby — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

add caching to vector computations & refactor vector classes to use it 
danielsdeleo (author)
Sun Aug 30 15:07:18 -0700 2009
commit  64b479c0c4682a928a64c9e9aaf83c18a6085a68
tree    8a42ad407362f7a37e7e30175a3472ea9adbf923
parent  9f959110faa94e33824db8952cffc35442786202
Decider /
name age
history
message
file .gitignore Sun Aug 09 10:00:58 -0700 2009 don't git intermediate results [danielsdeleo]
file LICENSE Tue Jul 07 21:58:25 -0700 2009 do what thou wilt shall be the whole of the law [danielsdeleo]
file README.rdoc Tue Aug 04 22:20:01 -0700 2009 a bit more about performance [danielsdeleo]
file Rakefile Fri Jul 03 21:36:23 -0700 2009 initial commit [danielsdeleo]
file TODO.feature Wed Jul 08 21:36:20 -0700 2009 moved bayes to its own module and improved impl... [danielsdeleo]
directory benchmark/ Thu Aug 20 06:10:33 -0700 2009 latest run; group repos via jaccard dist. k=50 [Ubuntu]
directory examples/ Sun Aug 02 10:14:03 -0700 2009 adjust example to updated method signature [danielsdeleo]
directory lib/ Sun Aug 30 15:07:18 -0700 2009 add caching to vector computations & refactor v... [danielsdeleo]
directory spec/ Sun Aug 30 15:07:18 -0700 2009 add caching to vector computations & refactor v... [danielsdeleo]
README.rdoc

Decider

Yet Another Ruby Machine Learning Library

Manifesto

There are other ruby machine learning libraries out there:

  • github.com/cardmagic/classifier
  • github.com/pauldix/basset
  • More?

So why another one?

  • You can install it and try it in irb right away. You don’t need to learn how a half-dozen classes work to get started:
          c = Decider.classifier(:spam, :ham)
          c.spam << "some spammy text"
          c.ham << "some hammy goodness"
          c.spam?("more spammy text")
          # => true
    

The default configuration is about 96% accurate as an email spam classifier.

  • You can control how it processes its input easily. Decider has built-in support for plain text and URIs, stemming words, stop word removal, and n-grams. All of these can easily be combined at your option (see "Getting Started" below for a quick example). Additional tokenization strategies or support for non-text document types can be added with a minimum of hassle.
  • Persist (Save) with Moneta. Pretty much any storage mechanism that’s available in ruby is supported. Save to a database and implement distributed classification if you like.
  • Clustering Analysis. Useful for recommendation algorithms. (In Progress)

Getting Started

  c = Decider.classifier(:spam, :ham) do |doc|
    doc.plain_text
    doc.ngrams(2..3)
    doc.stem
  end

  c.spam << "buy viagra, jerk" << "get enormous hot dog for make women happy"
  c.ham << "check out my code on github homie" << "let's go out for beers after work"

  p c.spam?("viagra for huge hot dog")
  # => true
  puts "term frequencies:"
  puts "spam: #{c.spam.term_frequency.inspect}"
  puts "ham:  #{c.ham.term_frequency.inspect}"
  puts ""
  p c.scores("let's write code and drink some beers")
  # => {:spam=>0.0, :ham=>1.0}
  p c.classify("let's write code and drink some beers")
  # => :ham

Performance

Decider has several benchmarks that also double as integration tests. These are run regularly and used to pinpoint CPU and RAM bottlenecks.

Decider does a lot of math and is fairly computationally intensive, so you want all the extra speed you can get. It is regularly tested with Ruby 1.9 and Jruby. I highly recommend using one of these Ruby implementations if at all possible if you plan on doing anything serious with Decider.

Also keep in mind that your dataset should reside entirely in memory or else you’ll hit a brick wall.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server