git clone git://github.com/urug/strategery.git
This is the project that the Utah Ruby Users Group has been working on with our hack nights. The plan has changed a bit, and unfortunately the code looks like a sausage recipe with footnotes. But it’s coming along. I’ve written a newbie-introduction to SVM that I think covers the salient facts without getting too bogged down into the details. You can find it at blog.teguhub.com. As for now, the goal of this project is to build a useful interface for Ruby SVM that will get all of the value that is exposed to us from libsvm. Then, if there’s interest, we can go further. So, we are:
-
Building a series of transformers to get data loaded into an SVM model from various stores (CSV, ActiveRecord, DataMapper, and CouchDB for now)
-
Implementing some scaling code to scale the data
-
Integrating various repositories, for discovering good practices at least. On the table: Arrays, RBTrees, Amalgalites, RNum Vectors
-
Writing a process manager to handle some of the pre-processing (scaling, cross-validating, and transforming)
These problems are semi-general to data analysis and will likely be useful for similar projects. Certainly there is a lot of cross-pollination between this project and Agency.
The name strategery is a Bush-ism, an effort to create meaning where maybe none existed. We hope that your classifications actually make sense.
-
An interface for training, scaling, cross-validating, and testing an SVM.
-
A transform interface for creating SVM-ready data.
-
A workflow tool for automatically classifying typical data sets.
require 'strategery' include SVM data = Transformer::CSV.load('traning_example.csv') model = Workflow.process(data) Transformer::CSV.load('testing_example.csv').each_line do |line| puts model.predict_probability(line) end
There are more examples in the examples directory.
-
libsvm
-
Ruby SVM
-
gem sources -a gems.github.com (you only have to do this once)
-
sudo gem install urug-strategery
Copyright © 2008-2009 Utah Ruby Users Group
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Special thanks to:
-
Rudi Cilibrasi (cilibrar@cilibrar.com) who wrote the Ruby SVM binding.
-
libsvm