public
Description: Ruby interface to LIBSVM (using SWIG)
Homepage: http://www.tomzconsulting.com
Clone URL: git://github.com/tomz/libsvm-ruby-swig.git
name age message
file .gitignore Sat Mar 21 20:13:42 -0700 2009 Follow naming conventions so requiring gem load... [danielsdeleo]
file AUTHORS Wed Mar 04 13:13:03 -0800 2009 merged in the gem packaging from feedbackmine(t... [tomz]
file COPYING Wed Mar 04 14:01:36 -0800 2009 rearranged some texts [tomz]
file History.txt Thu May 14 20:09:07 -0700 2009 Upgraded to LIBSVM 2.89 [tomz]
file Manifest.txt Thu May 14 20:38:26 -0700 2009 Renamed README.txt to README.rdoc [tomz]
file README.rdoc Fri Jul 10 08:44:42 -0700 2009 updated README [tomz]
file Rakefile Fri Jul 10 00:46:33 -0700 2009 force to use the Hoe gem version >=1.8.3 and <=... [tomz]
directory ext/ Fri May 15 13:46:20 -0700 2009 Sync with LIBSVM 2.89 files [tomz]
directory lib/ Fri May 15 14:03:03 -0700 2009 Sync with LIBSVM 2.89 files [tomz]
directory libsvm-2.88/ Thu May 14 18:44:17 -0700 2009 Added read_file; renamed svmc to libsvm; added ... [tomz]
directory libsvm-2.89/ Thu May 14 20:06:23 -0700 2009 Added LIBSVM 2.89 [tomz]
file libsvm-ruby-swig.gemspec Fri May 15 14:05:02 -0700 2009 Bumped gem version to 0.3.3 [tomz]
README.rdoc

libsvm-ruby-swig

DESCRIPTION:

This is the Ruby port of the LIBSVM Python SWIG (Simplified Wrapper and Interface Generator) interface.

A slightly modified version of LIBSVM 2.89 is included, it allows turrning on/off the debug log. You don’t need your own copy of SWIG to use this library - all needed files are generated using SWIG already.

Look for the README file in the ruby subdirectory for instructions. The binaries included were built under Ubuntu Linux 2.6.24-23-generic, you should run make under the libsvm-2.89 and libsvm-2.89/ruby directories to regenerate the executables for your environment.

LIBSVM is in use at tweetsentiments.com - A Twitter / Tweet sentiment analysis application

INSTALL:

Currently the gem is available on linux only(tested on Ubuntu 8 and Fedora 9/10, and on OS X by danielsdeleo), and you will need g++ installed to compile the native code.

  sudo gem sources -a http://gems.github.com   (you only have to do this once)
  sudo gem install tomz-libsvm-ruby-swig

SYNOPSIS:

Quick Interactive Tutorial using irb (adopted from the python code from Toby Segaran’s "Programming Collective Intelligence" book):

  irb(main):001:0> require 'svm'
  => true
  irb(main):002:0> prob = Problem.new([1,-1],[[1,0,1],[-1,0,-1]])
  irb(main):003:0> param = Parameter.new(:kernel_type => LINEAR, :C => 10)
  irb(main):004:0> m = Model.new(prob,param)
  irb(main):005:0> m.predict([1,1,1])
  => 1.0
  irb(main):006:0> m.predict([0,0,1])
  => 1.0
  irb(main):007:0> m.predict([0,0,-1])
  => -1.0
  irb(main):008:0> m.save("test.model")
  irb(main):009:0> m2 = Model.new("test.model")
  irb(main):010:0> m2.predict([0,0,-1])
  => -1.0

AUTHOR:

Tom Zeng