Skip to content

mrkamel/apriori

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages