Everyone is concerned with protecting user privacy and their data these days. Being capable of performing statistical analysis on data without actually keeping data samples around longer than necessary is one firm step in the right direction.
The concept of accumulators in the boost library looks like ideal fit to make it happen.
The Accumulators Framework is framework for performing incremental calculations. Usage of the framework follows the following pattern:
Users push data into the
accumulator_set<>object one sample at a time.The
accumulator_set<>computes the requested quantities in the most efficient method possible, resolving dependencies between requested calculations, possibly caching intermediate results.
There is just one big catch. I have no idea how to serialize the accumulator instance so that I can persist it without needing to keep the sample data around between app launches.
How to create an instance and restore all necessary parameters needed for it to apply new samples and continue its incremental computations? I do not want to start from scratch nor do I want to keep the previous samples around.