Skip to content

Latest commit

 

History

History
40 lines (22 loc) · 1017 Bytes

README.rdoc

File metadata and controls

40 lines (22 loc) · 1017 Bytes

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.