-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Moving Averages #100
Comments
+1 It would be great if this was a start to other statistical methods as well. |
You can certainly calculate averages using the custom reducer. Not sure how that would differ from moving averages? Not to speak for them, but in the past I believe the Crossfilter maintainers have said that specialized custom reducers should be maintained as separate projects and not baked into Crossfilter itself. |
I see. You need to use the groupAll functionality to do this. It takes On Fri, Jan 23, 2015 at 7:51 PM, Jack Stouffer notifications@github.com
|
I've just updated reductio to support arbitrary aggregations across arbitrarily defined windows as well as multi-value classification scenarios. The example is just a count aggregation, but it should work with average and the move complex aggregations as well. If you'd like to try it out: https://github.com/esjewett/reductio#aggregations-groupall-aggregations |
This library looks very useful, thanks. I will comment again when I have a working example of a moving average. |
Here is the solution with the above library. Unfortunately, it proved far too slow with a large amount of records. I guess that's the limitations of working in js Also, bonus support for dc.js
|
Glad it sort of worked. How many records of this form are we talking about? If in the 1000s or low 10000s, we can probably optimize. I'm not sure Reductio does this as efficiently as possible, so if you have a test dataset I can look at it. Probably best to discuss that over in the Reductio issues. Over the low 10000s or records, it might just not be manageable. |
Yeah, unfortunately my data contains 110,353 records and grows by about 50-100 every day. I simplified the data for this example, but the real data has eight columns, which brings the total size to about 16 MB. |
Are you within an order of magnitude on performance? If you switch your data to use strings for the date dimension instead of Date objects and optimize the Reductio groupAll function, that might buy you a 10x improvement. |
I created a new issue for this discussion crossfilter/reductio#12 |
Close with no comment? |
Sorry - your last comment seemed to be directing people to a new discussion so I didn't have anything else to add. See #151 for discussion of future of Crossfilter. I've updated square/crossfilter's README to indicate that the crossfilter org will be actively maintaining a fork. I figured you were already aware since you linked to reductio. Apologies for misunderstanding. |
Important because it displays on NPM.
Hello,
I would like to know if it's possible to calculate moving averages on a set of data or if the data passed in has to already have the averages calculated?
I have been thinking about this and I would need to have access to records outside of the current group or filter. If I pass in calculated moving averages then that data becomes obsolete when applying a filter from a different chart. Ideally I would like recalculate the moving averages on the new data set, just don't know how to access it in the reduce functions.
If it's possible, can you please provide a short example or a hint in the right direction.
Thank you,
The text was updated successfully, but these errors were encountered: