Live data from Hacker News

Performing Linear Regression Using Ruby

sharethrough.com

1–10 of 44 posts

Re: Performing Linear Regression Using Ruby

#3
Ruby is great for data prep, basic calculations, web app development, and scraping aggregating data and R for visualization. I find them to be a joyful combination. Great for small data sets, quick estimations, and various small projects.

Larger data sets and performance intensive operations are better handled in Python (or Java, C++, etc). Lots of statistical analysis is way below the threshold of Hadoop and company.

Re: Performing Linear Regression Using Ruby

#6
I think it is especially important to note that linear regression assumes that the relationship between the variables is, well, linear, and that in the real world, it very rarely actually is.

At best, a big asterisk should come from any of these results if you didn't have someone with actual experience validate your design/proposed analyses first.

Re: Performing Linear Regression Using Ruby

#9
post #3

Ruby is great for data prep, basic calculations, web app development, and scraping aggregating data and R for visualization. I find them to be a joyful combination. Great for small data sets, quick estimations, and various small projects. Larger data sets and performance intensive operations are better handled in Python (or Java, C++, etc). Lots of statistical analysis is way below the threshold of Hadoop and company…

I mostly agree with this, because I do like Ruby even though I don't use it.

The missing link here, and the reason Python gets more love from the data community, is that Python scales down to the smaller data sets as well as it handles big ones. (Not sure if you ment it couldn't, but the distinction you make implies that.)

Re: Performing Linear Regression Using Ruby

#10
We do regressions with rb-gsl.

    require 'gsl'
    x = GSL::Vector.alloc(array_of_x_values)
    y = GSL::Vector.alloc(array_of_y_values)
    c0, c1, cov00, cov01, cov11, chisq, status = GSL::Fit::linear(x, y)
It's not nearly as much work, and it's much faster than doing it in pure Ruby. :)

(It also does weighted regressions and exponential fitting, among a host of other things. That wheel's gone done been invented already.)

Post reply on HN