StatsBase.jl
StatsBase.jl copied to clipboard
dims keyword arg for `mad` ?
is there a reason not to have it so that the interfaces matches median, mean, std, etc. ?
I don't think so. I think it's partly because nobody has done the work and partly because there has been a slight trend towards using higher or functions like mapslices
instead of adding more keywords.
IIRC mapslices
used to be slow. was that the case, and if so, is it still?
It's been a while since I've seen any timings. It might be true but I think there are more alternatives now such as https://bramtayl.github.io/JuliennedArrays.jl/latest/ which I've heard should perform well.
mapslices
is slow as it makes copies, and it can't change until Julia 2.0. But eachslice
can be used instead.
If deciding to implement this instead of relying on eachslice
, it would be nice to implement this for sem
as well, if one is already on a roll.
I think sem.(eachrow(x))
, sem.(eachcol(x))
and sem.(eachslice(x, ...))
are the way to go now. Arguments probably won't be added because these syntaxes are short and explicit.