Collection Aggregates
These special aggregates involve operations with collection data types.
Sequence
returns an array of historical values for the given features
Syntax:
Sequence<event>(query)
Code Examples:
Sequence(path by session_id where duration > 5 seconds)
Sequence(ip, user_agent by user_id last 10 minutes)
Sequence(card_fingerprint by buyer, seller)
Sequence<page>(path by session_id)
Set
returns the set of unique historical values for the given features
Syntax:
Set<event>(query)
Code Examples:
Set(path by session_id where duration > 5 seconds)
Set(ip, user_agent by user_id last 10 minutes)
Set(card_fingerprint by buyer, seller)
Set<page>(path by user_id last week)
VectorAverage
returns the average of a vector (i.e. an array of floats) across time— commonly used with embeddings.
Syntax:
VectorAverage<event>(query)
Code Examples:
VectorAverage(product_vec by user_id last 2 hours)
VectorAverage(image_vec by author_id, category_id)
VectorAverage(text_vec by post_id where replied)
VectorAverage<search>(query_vec by session_id)