GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tomz/liblinear-ruby-swig: This is the Ruby interface to LIBLINEAR (much more efficient than LIBSVM for text classification and other large linear classifications)

BranchesTags
Open more actions menu

Latest commit

 

History

29 Commits
29 Commits

Folders and files

NameName
Last commit message
Last commit date
ext
ext
 
 
lib
lib
 
 
liblinear-1.8
liblinear-1.8
 
 
AUTHORS
AUTHORS
 
 
COPYING
COPYING
 
 
Gemfile
Gemfile
 
 
History.txt
History.txt
 
 
Manifest.txt
Manifest.txt
 
 
README.rdoc
README.rdoc
 
 
Rakefile
Rakefile
 
 
liblinear-ruby-swig.gemspec
liblinear-ruby-swig.gemspec
 
 

Repository files navigation

liblinear-ruby-swig

  • Ruby interface to LIBLINEAR (using SWIG)

  • www.tomzconsulting.com

  • tweetsentiments.com

DESCRIPTION:

This is the Ruby LIBLINEAR SWIG (Simplified Wrapper and Interface Generator) interface. LIBLINEAR is a high performance machine learning library for large scale text mining(www.csie.ntu.edu.tw/~cjlin/liblinear).

A slightly modified version of LIBLINEAR 1.8 is included which allows turning on/off the default debuging/logging messages. You don’t need your own copy of SWIG to use this library - all needed files are generated using SWIG already.

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

INSTALL:

Currently the gem is available on linux and OS X, 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-liblinear-ruby-swig

SYNOPSIS:

Try the following multiclass problem in irb:

irb(main):001:0> require 'rubygems'
irb(main):002:0> require 'linear'
irb(main):003:0> pa = LParameter.new
irb(main):004:0> pa.solver_type = MCSVM_CS 
irb(main):005:0> pa.eps = 0.1
irb(main):006:0> bias = 1
irb(main):007:0> labels = [1, 2, 1, 2, 3]
irb(main):008:0> samples = [
irb(main):009:1*            {1=>0,2=>0.1,3=>0.2,4=>0,5=>0},
irb(main):010:1*            {1=>0,2=>0.1,3=>0.3,4=>-1.2,5=>0},
irb(main):011:1*            {1=>0.4,2=>0,3=>0,4=>0,5=>0},
irb(main):012:1*            {1=>0,2=>0.1,3=>0,4=>1.4,5=>0.5},
irb(main):013:1*            {1=>-0.1,2=>-0.2,3=>0.1,4=>1.1,5=>0.1}
irb(main):014:1>           ]
irb(main):016:0> sp = LProblem.new(labels,samples,bias)
irb(main):017:0> m = LModel.new(sp, pa)
irb(main):018:0>  pred = m.predict({1=>1,2=>0.1,3=>0.2,4=>0,5=>0})
=> 1
irb(main):019:0>  pred = m.predict({1=>0,2=>0.1,3=>0.2,4=>0,5=>0})
=> 2
irb(main):020:0>  pred = m.predict({1=>0,2=>0.1,3=>0.2,4=>0,5=>0})
=> 2
irb(main):025:0>  pred = m.predict({1=>0.4,2=>0,3=>0,4=>0,5=>0})
=> 1
irb(main):021:0>  pred = m.predict({1=>-0.1,2=>-0.2,3=>0.1,4=>1.1,5=>0.1})
=> 3
irb(main):022:0> m.save("test.model")

For more examples see test*.rb in the liblinear-ruby-swig/liblinear-1.8/ruby directory

AUTHOR:

Tom Zeng

  • twitter.com/tomzeng

  • www.tomzconsulting.com

  • www.linkedin.com/in/tomzeng

  • tom.z.zeng at gmail dot com

About

This is the Ruby interface to LIBLINEAR (much more efficient than LIBSVM for text classification and other large linear classifications)

Resources

Readme
License
Activity

Stars

83 stars

Watchers

2 watching

Forks

11 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.