I want to use Apache Mahout in my project on Ruby on Rails for implementing recommendations and collaborative filtering. In Particular my requirements are:
I am open to using any other solution (other than mahout) if it integrates with rails easily and fulfills my requirements.
Mahout (and Hadoop) work pretty well within Rails running on JRuby. You can include Hadoop and Mahout jars like so:
require 'rubygems'
require 'java'Dir["/mahout-base-dir/**/*.jar"].each { |jar| require jar }
Dir["/hadoop-base-dir/**/*.jar"].each { |jar| require jar }
Then you can include the Mahout classes you plan on using, for instance:
include_class 'org.apache.hadoop.fs.Path'
include_class 'org.apache.hadoop.conf.Configuration'
include_class 'org.apache.hadoop.fs.FileSystem'
include_class 'org.apache.mahout.clustering.spectral.common.AffinityMatrixInputJob'
include_class 'org.apache.mahout.clustering.spectral.kmeans.SpectralKMeansDriver'
From there, you can follow the Mahout Java Docs and JRuby conventions to build your Rails rec system.
That being said, I'm not sure that would be the best architecture for your site (hard to say without more detail). If your problem scale is large enough to warrant Mahout, it probably makes more sense to use Rails for just the web stuff, and generate your recommendations outside the web framework (for instance by generating affinities in nightly batches, etc.).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With