Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running multi variable regression from a CSV: `_check_type': NoMethodError #40

Open
multimeric opened this issue Mar 25, 2015 · 1 comment

Comments

@multimeric
Copy link

I'm not really sure what's happening here. For some reason if the y value is high precision and I try to run a regression on it, I get this error. However this only works if the high precision data is in a CSV. It won't work as a number literal so it could be an issue with the CSV module itself. I should note that I'm running on Windows (8.1, 64 bit) so this might be an implementation issue.

The simplest code I can get this issue down to is as follows:

require 'statsample'
ds = Statsample::CSV.read("input.txt")
regression = Statsample::Regression.multiple(ds,'y')

And you'll need a file "input.txt" in the same directory with the following data:

x,y
1,9.629587310436753e+127
2,1.9341543147883677e+129
3,3.88485279048245e+130

The full stack trace is:

E:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/statsample-1.4.0/lib/statsample/vector.rb
:161:in `_check_type': NoMethodError (NoMethodError)
        from E:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/statsample-1.4.0/lib/statsam
ple/vector.rb:155:in `check_type'
        from E:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/statsample-1.4.0/lib/statsam
ple/vector.rb:911:in `mean'
        from E:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/statsample-1.4.0/lib/statsam
ple/regression/multiple/rubyengine.rb:23:in `initialize'
        from E:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/statsample-1.4.0/lib/statsam
ple/regression.rb:62:in `new'
        from E:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/statsample-1.4.0/lib/statsam
ple/regression.rb:62:in `multiple'
        from script.rb:3:in `<main>'
@agarie
Copy link

agarie commented Mar 25, 2015

Hi @TMiguelT, thanks for reporting this issue! We recently moved the upstream to SciRuby's organization page on GitHub, so could you post this issue there, so we can keep track of it? The repository is in the following link:

https://github.com/sciruby/statsample

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants