Skip to content

hungryblank/rrbayes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rrbayes (Ruby Redis Bayes)

Description

Rrbayes is a basic and simplified implementation of a naive bayesian classifier.

It uses Redis github.com/antirez/redis to store the information necessary for the classification, this gives Rrbayes persistency and parallel processing support

Rrbayes has been inspired by github.com/cardmagic/classifier

Development status

At this stage Rrbayes is more than anything else an excuse to use Redis

Usage

require 'rrbayes'

classifier = Rrbayes::Classifier.new :categories => :spam, :ham

classifier.learn({'enlarge' => 1, 'your' => 2 ,'viagra' => 3} :as => 'spam')

classifier.learn({'dear' => 1, 'Jon' => 2 ,'how' => 3}, :as => 'ham'))

classifier.classify({'viagra' => 1, 'cheap' => 1})
=> 'spam'

Thanks

Author

Copyright © 2009 hungryblank. See LICENSE for details.

About

ruby bayes naive classifier implementation that uses Redis as backend

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages