News for hackers. Stuff that matters.
Re:Python vs Julia – an example from machine learning by Sweyla on Tuesday March 11, 2014 @09:16PM (#7383368)
No kidding the Active Set solution in Cython is slow, it barely leverages Cython at all! It uses a Python list which is managed by Python and uses none of Cython's static typing.

Implement the algorithm inside a "with nogil" and you will see some nice speed-ups. It won't look pretty, but for certain performance-sensitive code it will be worth it.

Re:Python vs Julia – an example from machine learning by ajtulloch on Tuesday March 11, 2014 @09:19PM (#7383376)
Hi, author here.

Yeah, the active set implementation in Cython is relatively slow - see [1] for where I discussed how I benchmarked the existing algorithm and demonstrated the PAVA implementation was faster.

Then again, until two days ago the Cython active set algorithm was the production implementation of isotonic regression in scikit-learn, so it's not like it was a strawman example that I made up.

[1]: http://tullo.ch/articles/speeding-up-isotonic-regression/

Re:Python vs Julia – an example from machine learning by Sweyla on Tuesday March 11, 2014 @09:52PM (#7383475)
Try this implementation for PAVA:

https://gist.github.com/gustavla/9499068

Also, how are you timing Python? When I run this on a sample size of 10 using IPython's %timeit, it takes a few microseconds, which is 2 orders of magnitude from what you report.