Open
Description
Hello,
It looks like numpy is allocating a whole new array to compute the second moment as seen in _methods.py.
This could be easily improved by adding a low level function to compute the sum of squares (or any power for fast nth moment computation) along a dimension and expanding the square in _var
.
It does not look too complicated but I'm really unsure on how to do the low level function (loops.c.src
?)
This should help with scikit-learn/scikit-learn#5651