Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apriori

This is another ruby wrapper gem for the apriori implementation of Christian Borgelt. Currently, this is more a dirty hack, since the binary is included and the items may not include any commas and semicolons. However, using this gem is really simple and straight forward if you're using an amd64 architecture and a linux box.

def calculate
  rules = []

  Apriori.rules do |apriori|
    apriori.add_transaction ["beer", "cheese"]
    apriori.add_transaction ["beer", "mr.tom"]
    apriori.add_transaction ["beer", "cheese"]

    apriori.each do |rule|
      rules.push rule
    end
  end

  rules
end

irb> calculate
=> [{:destination=>["beer"], :source=>["mr.tom"], :support=>25.0, :confidence=>100.0}, ...]

Installation

Gemfile:

gem "apriori", :git => "git://github.com/mrkamel/apriori.git"

About

Another ruby apriori wrapper

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages