Sunday, January 14, 2007

RARFF - A simple ARFF library in Ruby

RARFF is a very simple ARFF handling library for Ruby that I wrote for kicks. ARFF is a file format popularized by Weka, the machine learning toolkit.

I've had a couple of cases where I collected some data using Ruby and I wanted to analyze it with Weka. This makes it a bit easier.

6 comments:

Alberto said...

Hi, I read your post about RAFF and I'm currently doing something similar, I've got a browser application that collects data in a database and I wanna mine this data and get some results out of the analysis made with WEKA. For that I want to be able to manage RAFF files. Could you please explain me how I could do it? Thank you.

Alberto said...

Hi, I read your post about RAFF and I'm currently doing something similar, I've got a browser application that collects data in a database and I wanna mine this data and get some results out of the analysis made with WEKA. For that I want to be able to manage RAFF files. Could you please explain me how I could do it? Thank you.

Andy Payne said...

Do you use Ruby on Rails?

Once you get the data out of the database and into a ruby object (such as with ActiveRecord), you can use RARFF to export it as an ARFF file. The unit test file ts_arff.rb shows how to export ruby data in ARFF format.

After that, it's a cinch to load it up in Weka.

Hope this helps.

ashishwave said...

It would have helped , if had given a concrete simple example (helloworld kind of), as to how to use this library
say at the homepage of the project itself
http://rarff.rubyforge.org

bye :-)
Ashish

Ben said...

Hi,

Thanks for this - is of use for exactly the same reason. Any chance of pushing this to github so that it can be forked? I'd like to fix the missing data problem.

Thanks,
ben

Ben said...

Created a github with fixes for the missing data and a bunch of other changes, but had to drop support for reading ARFF files and outputing sparse data, because for the moment I don't care enough.

http://github.com/wwood/rarff