Skip to content

A Simple LOESS / LOWESS calculator that can be used from Ruby

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt
Notifications You must be signed in to change notification settings

swanandp/loess.rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loess

Simple Loess / Lowess interpolator built in Ruby, using Apache's LoessInterpolator through Rjb

Installation

Add this line to your application's Gemfile:

gem 'loess'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install loess

Depencies

This gem depends on Rjb, which in turn depends on Java. Rjb documentation has more info.

Usage

data = 1000.times.map { |i| [i, rand(10_000)] }

regression = Loess::Interpolator.interpolate(data)
regression = Loess::Interpolator.new(data).interpolate

# Change your settings

interpolator = Loess::Interpolator.new(data)
interpolator.bandwidth = 0.2
interpolator.robustness_factor = 10 # Go crazy
interpolator.interpolate

# Pass in settings through initialize
interpolator = Loess::Interpolator.new(data, bandwidth: 0.2, accuracy: 1e-10)
interpolator.interpolate

# Get a Spline Interpolator object
# Returns an instance of PolynomialSplineFunction, smoothed with the given data
# More documentation at [Apache Commons Maths][2]
interpolator.spline_interpolator

Contributing

At this moment, there is little to contribute, but still:

  1. Fork it ( https://github.com/swanandp/loess.rb/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

A Simple LOESS / LOWESS calculator that can be used from Ruby

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages