datashader icon indicating copy to clipboard operation
datashader copied to clipboard

Geometric mean and median as reduction functions

Open suyang-nju opened this issue 6 years ago • 1 comments

This is a feature request for adding geometric mean and median to the list of reduction functions in datashader. For now, a work around for doing geometric mean is to use ds.mean() on log transformed data during aggregation, and then transform back.

suyang-nju avatar May 23 '18 16:05 suyang-nju

Computing the geometric mean should be straightforward, starting from the code for the arithmetic mean, and I would welcome a PR to add that to datashader, as long as it had tests that verified the results against those obtained from an independent implementation.

I know less about geometric medians, but computing the arithmetic median efficiently is not trivial, and I suspect the same would be true for the geometric median. This paper proposes an efficient algorithm for approximating the geometric median, and if that works well I'd also be happy to include it in datashader.

jbednar avatar May 23 '18 17:05 jbednar