Project

rrbayes

0.01
No commit activity in last 3 years
No release in over 3 years
Implementation of a naive Bayes classifier with a Redis backend
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 2.0.0
 Project Readme

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.