You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SpatialAggregate class in flowmachine allows to aggregate metrics spatially - e.g. going from a location associated with each subscriber (such as daily_locations) to a subscriber count per admin region.
However, some metrics (e.g. subscriber-focused ones) don't allow intrinsic spatial aggregation. For example, Displacement or RadiusOfGyration associate a number (representing the distance of displacement / radius of gyration) with each subscriber but there is no way to intrinsically aggregate this to spatial units (without assigning a "reference location" for each subscriber - which is what JoinedSpatialAggregate allows to do).
For metrics of the latter kind it would be useful to support a histogram aggregation. This should accept a metric (such as Displacement, RadiusOfGyration, etc.) and the bins and range parameters as supported by numpy.histogram. The return value should be the same pair hist_values, bin_edges as returned by numpy.histogram. (This can then separately be fed into a plotting function or otherwise processed.)
For now, as a first prototype it should be ok to do the calculation in Python, although this won't work for large data amounts and we will soon want to push the calculation into Postgres (but let's address this in a separate issue). Also, we will want to expose this functionality through the API, which will also be tracked in a separate issue.
The text was updated successfully, but these errors were encountered:
The
SpatialAggregate
class in flowmachine allows to aggregate metrics spatially - e.g. going from a location associated with each subscriber (such asdaily_locations
) to a subscriber count per admin region.However, some metrics (e.g. subscriber-focused ones) don't allow intrinsic spatial aggregation. For example,
Displacement
orRadiusOfGyration
associate a number (representing the distance of displacement / radius of gyration) with each subscriber but there is no way to intrinsically aggregate this to spatial units (without assigning a "reference location" for each subscriber - which is whatJoinedSpatialAggregate
allows to do).For metrics of the latter kind it would be useful to support a histogram aggregation. This should accept a metric (such as
Displacement
,RadiusOfGyration
, etc.) and thebins
andrange
parameters as supported by numpy.histogram. The return value should be the same pairhist_values
,bin_edges
as returned bynumpy.histogram
. (This can then separately be fed into a plotting function or otherwise processed.)For now, as a first prototype it should be ok to do the calculation in Python, although this won't work for large data amounts and we will soon want to push the calculation into Postgres (but let's address this in a separate issue). Also, we will want to expose this functionality through the API, which will also be tracked in a separate issue.
The text was updated successfully, but these errors were encountered: