From: Matt Mower Date: 2005-04-12T16:47:47+09:00 Subject: Re: [ANN| Bayesian Classification for Ruby On Apr 12, 2005 4:32 AM, "Pe�a, Botp" wrote: > Matt Mower [mailto:matt.mower@gmail.com] wrote: > > #> http://rubyforge.org/projects/classifier/ > #> > # > #;-) > # > #I ported the Reverend bayesian classifier from Python to Ruby > #over the weekend. If only I'd waited ;-) > > did you finished the port? Are you using it? > Yes I finished porting the code and it seems to work for the Robinson method although what I haven't done yet is verify that it produces the same results as Reverend, i.e. have I ported it properly? Using the Robinson-Fisher method doesn't seem to work so I think I need to go back and look at my implementation of that algorithm again. Here is Lucas' example using Bishop: require 'bishop' # The block passed here is actually mimicing the default behaviour however # I add it here to show how the probability combiner algorithm is replaced, # e.g. with Bishop::robinson_fisher b = Bishop::Bayes.new { |probs,ignore| Bishop::robinson( probs, ignore ) } 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.guess( "I hate bad words and you" ).each { |c| puts c.join( " = " ) } outputs uninteresting = 0.9999 Is there anyone with some python savvy who'd like to collaborate on testing? M -- Matt Mower :: http://matt.blogs.it/