← Back to team overview

software-store-developers team mailing list archive

Re: Specification for "Top Rated" sections

 

On Thu, Jun 23, 2011 at 3:34 AM, Matthew Paul Thomas <mpt@xxxxxxxxxxxxx> wrote:

> (I would like to be able to include, in the specification, test cases
> with expected numeric results that weren't calculated by the actual USC
> implementation. But I have neither a book of statistical tables to
> calculate it by hand, nor the ability to figure out quickly how to
> install the statistics2 Ruby gem to try the sample code on the above Web
> page. So if anyone would like to help out with that too, that would be
> great.)
>

I had a look around to see if I could find a python implementation of
pnormaldist but didn't run into any luck.

So I've used the ruby source to re-write the ruby
statistics2.pnormaldist function in python so we can easily utilise
this instead of having to rely on the ruby version.

The file pnormaldist.tar.gz available here (http://db.tt/Bx9hmu0) has
two scripts in it.
pnormaldist.py - my python re-write and a main function to print the
output of pnormaldist with values of 0.1 to 0.9 in 0.1 steps
pnormaldist.rb. - the original statistics2.pnormaldist ruby function
and print statements to print the same output

Run like this:
python pnormaldist.py
ruby pnormaldist.rb

to confirm the function works as expected. Change the values in the
print functions as required to test other arguments.

If happy with the results, we can add the python version to USC's
utils.py and use this in the function to create the other function
which we can use to calc the Wilson Score

cheers
Aaron


Follow ups

References