4 ms·
In terms of the heavy nesting, that's born out of performance measurements - factoring out the inner loop into a `cdef inline` function in Cython appeared to be
by ajtulloch 13y ago
In terms of the heavy nesting, that's born out of performance measurements - factoring out the inner loop into a `cdef inline` function in Cython appeared to be a performance hit, so I manually inlined it. When it came for the Julia implementation, I wanted to keep it as similar as possible to the tuned Cython implementation for pedagogical purposes.
In general, if anyone has performance improvements or code cleanups to the Cython PAVA code [1] (the implementation used by scikit-learn), please benchmark and send a pull request over to the scikit-learn team. I'm sure they'll be very happy to accept improvements.
[1]: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/_isotonic.pyx https://github.com/scikit-learn/scikit-learn/blob/master/skl...
- sesqu 13y agoThis isn't github, but I'll point out one cleanup: # solution[i:k + 1] is a decreasing subsequence, so should read # solution[i:k] is a decreasing subsequence, so