Skip to content
/ ml4r Public
forked from jamiecook/gocard-ruby-api

A simple Ruby interface to access the Queensland Transport GoCard website.

Notifications You must be signed in to change notification settings

vlc/ml4r

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine Learning 4 Ruby

Description

A Ruby based library of Maching Learning algorithms.

Supports:

  • Least Squares Linear Regression

Installation

gem install ml4r

Requirements

The entire library is built using SWIG and as such it requires the boost c++ library.
To install on ubuntu / debian distros
    sudo apt-get install libboost-dev

To install on Mac OS/X you can use either of the following depending on whether you prefer macports or homebrew
    sudo port install boost
     OR
    sudo brew install boost

To install on Windows, you'll have to download and unzip the source yourself (sorry)
    http://www.boost.org/users/download/#live

Usage

require 'ml4r'
regression = Ml4r::OLSLinearRegression.new([1.0, 2.0, 3.0], [1.0, 2.0, 3.0])

puts regression.getParameterEstimates()     # => [[0.9999999999999993], 1.5543122344752192e-15]
puts regression.getRSquared()               # => 1.0
puts regression.getFittedYs()               # => [1.0000000000000009,2.0,3.0]
puts regression.getPredictedYs()            # => [1.0000000000000053,2.0,3.0]
puts regression.getSSquared()               # => 7.888609052210118e-31
puts regression.getFstatistic()             # => 2535301200456456600000000000000.0
puts regression.getTstatistics()            # => [1592262918131443.0, 1.1456439237389604]
puts regression.getStandardErrors()         # => [6.280369834735097e-16, 1.3567149463006932e-15]
puts regression.getPressStatistic()         # => 2.8398992587956324e-29
puts regression.getPresarStatistic()        # => 0.0
puts regression.getAdjustedRSquared()       # => 1.0
puts regression.getRSquaredPrediction()     # => 1.0

About

A simple Ruby interface to access the Queensland Transport GoCard website.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 53.5%
  • C++ 44.8%
  • Perl 0.6%
  • JavaScript 0.4%
  • Scala 0.3%
  • Ruby 0.3%
  • Other 0.1%