Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/mruby-correlation
Extended Array class for correlation coefficient
https://github.com/matsumotory/mruby-correlation
Last synced: about 2 months ago
JSON representation
Extended Array class for correlation coefficient
- Host: GitHub
- URL: https://github.com/matsumotory/mruby-correlation
- Owner: matsumotory
- License: other
- Created: 2016-06-01T06:38:02.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-03T08:50:38.000Z (over 8 years ago)
- Last Synced: 2024-10-18T18:26:01.611Z (3 months ago)
- Language: C
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mruby-correlation [![Build Status](https://travis-ci.org/matsumoto-r/mruby-correlation.svg?branch=master)](https://travis-ci.org/matsumoto-r/mruby-correlation)
Extended Array class for correlation coefficient
## install by mrbgems
- add conf.gem line to `build_config.rb````ruby
MRuby::Build.new do |conf|# ... (snip) ...
conf.gem :mgem => 'mruby-correlation'
end
```## example
```ruby
assert("Array#correlation_coefficient_with") do
d = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
assert_equal(1.0, d.correlation_coefficient_with([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]))
assert_equal(1.0, d.correlation_coefficient_with(d))
assert_equal(1.0, d.correlation_coefficient_with(d.map{|a|a/2}))
assert_equal(-1.0, d.correlation_coefficient_with(d.reverse))
assert_equal(0.9923373049285564, d.correlation_coefficient_with([2, 3, 3, 4, 6, 7, 8, 9, 10, 11]))
assert_equal(-0.9803906931996748, d.correlation_coefficient_with([15, 13, 12, 12, 10, 10, 8, 7, 4, 3]))
end
```## License
under the MIT License:
- see LICENSE file