[Biopython-dev] [Bug 2657] Improved Bio/Statistics/lowess.py

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Nov 14 11:38:51 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2657





------- Comment #8 from biopython-bugzilla at maubp.freeserve.co.uk  2008-11-14 06:38 EST -------
(In reply to comment #5)
>> I personally think using an explicit matrix solver is much nicer to read
>> than that complex hand coded version.  Does it really save much time?
>> ...
>> However, I'm going to leave this for Michiel to resolve (given he wrote
>> the code in the first place).
>> 
> 
> Yes-- replacing numpy saves quite a bit of time. When I replaced the variable
> so they werent recalculated every single time, it reduced unit test time 17%
> compared to the original then repaklcing numpy receduced it to a net 38% from
> the original so huge difference.

OK - so its clarity versus what sounds like a big speed difference.

> Also, I suggest changing something if you all
> decided to keep numpy. Minor but just a suggestion.
> 
> >             weights_x = weights*x
> >             sum_weights_x = sum(weights_x)
> >             b = numpy.array([sum(weights*y), sum(weights_x*y)])
> >             A = numpy.array([[sum(weights),   sum_weights_x],
> >                        [sum_weights_x, sum(weights_x*x)]])
> 

I see, in defining b, sum(weights*y*x) can be done as sum(weights_x*y) which
avoids creating the temp variable weights_y = weights*y, that does look better.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list