README.md in rb-libsvm-1.0.9 vs README.md in rb-libsvm-1.0.10

- old
+ new

@@ -1,39 +1,48 @@ # rb-libsvm -- Ruby language bindings for LIBSVM -Spec Status: [![Build Status](https://secure.travis-ci.org/febeling/rb-libsvm.png)](http://travis-ci.org/febeling/rb-libsvm) +[![Build Status](https://secure.travis-ci.org/febeling/rb-libsvm.png)](http://travis-ci.org/febeling/rb-libsvm) This package provides a Ruby bindings to the [LIBSVM][] library. SVM is a machine learning and classification algorithm, and LIBSVM is a popular free implementation of it, written by Chih-Chung Chang and Chih-Jen Lin, of National Taiwan University, Taipei. See the book ["Programming Collective Intelligence,"](http://books.google.com/books?id=fEsZ3Ey-Hq4C) among others, for a usage example. Note: There exist two other Ruby bindings for LIBSVM. One is named -"Ruby SVM," and is written by Rudi Cilibrasi. It is hard to find -nowadays. The other, more actively developed one is -[libsvm-ruby-swig][svmrubyswig] by Tom Zeng, which is built using -SWIG. +[Ruby SVM][ruby-svm], written by Rudi Cilibrasi. The other, more +actively developed one is [libsvm-ruby-swig][svmrubyswig] by Tom Zeng, +which is built using SWIG. -## Dependencies +LIBSVM includes a number of command line tools for preprocessing +training data and finding parameters. These tools are not included in +this gem. You should install the original package if you need them. -None. LIBSVM is bundled with the project. Just install and go! +It is helpful to consult the Readme of the LIBSVM package for +reference when configuring the training parameters. Currently this package includes libsvm version 3.13. -LIBSVM includes a number of command line tools for preprocessing -training data and finding parameters. These tools are not included in -this gem. You should install the original package if you need these. -It is also helpful to consult the Readme of the LIBSVM package for -reference when configuring the training parameters. +## Dependencies +None. LIBSVM is bundled with the project. Just install and go! + ## Installation +For building this gem from source on OS X (which is the default +packaging) you will need to have Xcode installed, and from within Xcode +you need to install the command line tools. Those contain the compiler +which is necessary for the native code, and similar tools. + +To install the gem run this command + gem install rb-libsvm ## Usage +This is a short example of how to use the gem. + ```ruby require 'libsvm' # This library is namespaced. problem = Libsvm::Problem.new @@ -53,10 +62,22 @@ pred = model.predict(Libsvm::Node.features(1, 1, 1)) puts "Example [1, 1, 1] - Predicted #{pred}" ``` +If you want to rely on Bundler for loading dependencies in a project, +(i.e. use `Bundler.require` or use an environment that relies on it, +like Rails), then you will need to specify rb-libsvm in the Gemfile +like this: + +```ruby +gem 'rb-libsvm', require: 'libsvm' +``` + +This is because the loadable name (`libsvm`) is different from the +gem's name (`rb-libsvm`). + ## Author Written by C. Florian Ebeling. ## Contributors @@ -80,5 +101,7 @@ http://www.igvita.com/2008/01/07/support-vector-machines-svm-in-ruby/ [libsvm]: http://www.csie.ntu.edu.tw/~cjlin/libsvm/ [svmrubyswig]: http://github.com/tomz/libsvm-ruby-swig/tree/master + +[ruby-svm]: http://sourceforge.net/projects/rubysvm/