Calculate Array Statistics

I am creating a web application that should calculate statistics on a dataset. I need to calculate percentiles, averages, modes and other statistical functions on arrays.

Usually in Python I simply used scipy, numpy or nltk, which has a huge library of stat array functions. Are there any ruby ​​stones or libraries that I can use for this?

In the absence of any existing libraries, is there an easy way to do data processing in Python by storing my application in Ruby / Rails?

+8
ruby statistics
source share
6 answers

If you really need a complete statistics library, check out the statsample . Otherwise, you may find descriptive_statistics as a nice, easy alternative.

+7
source share

You might be able to use Rubystats or Easystats . I am sure there are more stones that I do not know about.

+1
source share

For numcrunching, Narray is a standard recommendation. These are statistical methods: summation, cumulative summation, product (multiplication elements), cumulative production, mean, standard deviation, mean square, standard deviation from the root, minimum, maximum and median.

Being specialized for numbers, he argued that it would be 50 times faster and more efficient for storing arrays.

0
source share

If you compute statistics on ActiveRecord models, you probably want to check the statistics gem.

I also bookmarked statisticus , which offers GNU-R and SIRB integration for use in the console.

There are many ways to run Python under a Rails application, but it is probably easier to find the methods you need in the Ruby library.

0
source share

I have implemented a new Gem-MDArray that does statistics in JRuby. This can be really good for a web application since JRuby is mostly Java. MDArray follows the philosophy of NArray and Numpy, and at this point it is probably slower than both, it should be faster than a pure Ruby alternative.

Check it out, and if you need help, I will be happy to try and help.

Greetings

Rodrigo

0
source share

You can use NMatrix , which is a numerical library similar to NumPy in ongoing development. (disclaimer: I'm from the SciRuby / NMatrix team)

0
source share

All Articles