simple_classifier

Bayesian Classification without a lot of fuss

Installation

  • gem install simple_classifier

simple_classifier depends on Martin Porter’s stemmer gem, which should be installed when you run the command above.

Usage

require 'simple_classifier'
b = Classifier::Bayes.new 'Interesting', 'Uninteresting'
b.train_interesting "here are some good words. I hope you love them"
b.train_uninteresting "here are some bad words, I hate you"
b.classify "I hate bad words and you" # returns 'Uninteresting'

More info on Bayesian Classification

Authors

This library is released under the terms of the GNU LGPL. See LICENSE for more details.