Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregate: geometric mean? #575

Closed
jowens opened this issue Sep 15, 2015 · 5 comments
Closed

aggregate: geometric mean? #575

jowens opened this issue Sep 15, 2015 · 5 comments

Comments

@jowens
Copy link

jowens commented Sep 15, 2015

This might be a vega issue, not vega-lite, but:

Could you support a geometric-mean? I see "avg", which I assume is an arithmetic mean, and you have "median". I know I'll need geomean in the not too distant future.

@jheer
Copy link
Member

jheer commented Sep 15, 2015

In Vega (and the underlying aggregator in datalib), this could be realized via sums of log-transformed values followed by post-aggregate exponentiation. Basically, combining Vega formula and aggregate transforms. (Similar strategies apply to the harmonic mean.) Whether or not we should surface these as high-level options in vega-lite is another question, as we might translate those aggregates to multiple Vega transforms.

Related stack overflow article about SQL: http://stackoverflow.com/questions/3912204/why-is-there-no-product-aggregate-function-in-sql This is also relevant to us as we consider future work partitioning the data flow across client and server.

@jowens
Copy link
Author

jowens commented Sep 16, 2015

Fascinating, thanks for the perspective!

It would seem from the API point of view that one of the interesting design points for vega-lite would be how to drop in (call out to?) a Vega feature if that was desired. This would be a good example; I kind-of doubt that vega-lite will support formula and aggregate directly (feel free to tell me I'm wrong), but something in vega-lite syntax that directly "called" Vega would be useful. (In the alternative, I would personally plan to convert vega-lite to Vega and then patch the Vega JSON, but that's not exactly portable.)

@domoritz
Copy link
Member

You are totally right. We would like to have a way for users to specify parts of their spec in vega if vega-lite is not expressive enough. However, we have not yet found a clean way to do this in the spec and in the code. I am afraid that this is a major feature that requires some rewriting.

@kanitw kanitw modified the milestone: x.x (Should Have Later) Oct 3, 2015
@kanitw
Copy link
Member

kanitw commented Jan 16, 2016

This is more like a datalib issue, so if you strong feel we should support this now, please file it in the datalib repo. :)

@g3o2
Copy link
Contributor

g3o2 commented Oct 14, 2016

I've provided a workaround (pow) in the issue referenced here above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants