Skip to content

DatasetsEvaluation

SaraPettinari edited this page Dec 15, 2025 · 6 revisions

Aggregation Steps - Datasets

This document outlines a series of aggregation steps used for aggregating EKGs of different datasets and the resulting performances.


Soccer (Italy league)

Steps:

step1 = AggrStep(aggr_type="ENTITIES", ent_type="playerId", group_by=["role"], 
            where="birthYear > 1990", attr_aggrs=[])

step2 = AggrStep(aggr_type="ENTITIES", ent_type="pos_orig", 
            group_by=["zone"], where=None, attr_aggrs=[])

step3 = AggrStep(aggr_type="EVENTS", ent_type=None, where='matchId = "2575959"', 
            group_by=[log.event_activity, "teamId", "playerId"], 
            attr_aggrs=[AttrAggr(name=log.event_timestamp, function=AggregationFunction.MINMAX),
                    AttrAggr(name="teamId", function=AggregationFunction.MULTISET)])

step4 = AggrStep(aggr_type="EVENTS", ent_type=None, where='matchId <> "2575959"', 
            group_by=[log.event_activity, "teamId", "playerId"], 
            attr_aggrs=[AttrAggr(name=log.event_timestamp, function=AggregationFunction.MINMAX),
            AttrAggr(name="teamId", function=AggregationFunction.MULTISET)])

Performance:

Step #Init Events #Final Events #Init Entities #Final Entities Query Exec Time (s)
Step1 647300 647300 560 238 0.09311890602
Step2 647300 647300 238 231 0.04447603226
Step3 647300 645687 231 231 0.2441709042
Step4 645687 0 231 231 12.88117909
Finalization 0 0 231 0 0.2358920574
Rel Inference 0 0 0 0 9.124970913

Order Management

Steps:

    step1 = AggrStep(aggr_type="ENTITIES", ent_type= "customers", group_by=["id"], 
            where=None, attr_aggrs=[AttrAggr(name='id', function=AggregationFunction.MULTISET)])

    step2 = AggrStep(aggr_type="ENTITIES", ent_type= "orders", group_by=[ekg.type_tag], 
            where='price >= 1000', attr_aggrs=[AttrAggr(name='price', function=AggregationFunction.AVG)])
    
    step3 = AggrStep(aggr_type="ENTITIES", ent_type= "employees", group_by=['role'], where=None, attr_aggrs=None)

    step4 = AggrStep(aggr_type="EVENTS", ent_type= None, group_by=[log.event_activity, "customers", "orders"],
            where=f'{log.event_timestamp} >= datetime("2024-03-31T00:00:00")', attr_aggrs=[]) # I want to check all the orders after Easter
    
    step5 = AggrStep(aggr_type="EVENTS", ent_type= None, group_by=[log.event_activity, "customers", "orders"], 
            where=f'{log.event_timestamp} < datetime("2024-03-31T00:00:00")', attr_aggrs=[]) # I want to check all the orders before Easter

Performance:

Step #Init Events #Final Events #Init Entities #Final Entities Query Exec Time (s)
Step1 21008 21008 10840 10825 0.08737683296
Step2 21008 21008 10825 9363 0.06592798233
Step3 21008 21008 9363 9345 0.002074956894
Step4 21008 20851 9345 9345 0.1214411259
Step5 20851 0 9345 9345 1.024273872
Finalization 0 0 9345 0 0.1178059578
Rel Inference 0 0 0 0 1.039471865

Procure-to-Pay (P2P)

Steps:

step1 = AggrStep(aggr_type="ENTITIES", ent_type= "material", group_by=[ekg.type_tag],where='Delivery_Date_EKPO_BEDAT < dateTime("2023-10-24T09:30:27.930832")', attr_aggrs=[AttrAggr(name='Quantity_EKPO_MENGE', function=AggregationFunction.AVG), AttrAggr(name='Net_Price_EKPO_NETPR', function=AggregationFunction.SUM)])

step2 = AggrStep(aggr_type="ENTITIES", ent_type= "material", group_by=[ekg.type_tag], where='Delivery_Date_EKPO_BEDAT >= dateTime("2023-10-24T09:30:27.930832")', attr_aggrs=[AttrAggr(name='Quantity_EKPO_MENGE', function=AggregationFunction.AVG), AttrAggr(name='Net_Price_EKPO_NETPR', function=AggregationFunction.SUM)])

step3 = AggrStep(aggr_type="ENTITIES", ent_type= "purchase_requisition", group_by=['Purchasing_Group_EBAN_EKGRP'], where=None, attr_aggrs=None)

step4 = AggrStep(aggr_type="EVENTS", ent_type= None, where=None, group_by=[log.event_activity, "material"], attr_aggrs=[])

Performance:

Step #Init Events #Final Events #Init Entities #Final Entities Query Exec Time (s)
Step1 14671 14671 8616 6960 0.0979719162
Step2 14671 14671 6960 6320 0.05964684486
Step3 14671 14671 6320 5393 0.04818797112
Step4 14671 0 5393 5393 0.6098949909
Finalization 0 0 5393 0 0.0914850235
Rel Inference 0 0 0 0 0.1724762917

Logistics

Steps:

step1 = AggrStep(aggr_type="ENTITIES", ent_type= "Container", group_by=["Status"], where=None, 
        attr_aggrs=[AttrAggr(name='id', function=AggregationFunction.MULTISET), AttrAggr(name='Weight', function=AggregationFunction.AVG), 
        AttrAggr(name='Amount_of_Handling_Units', function=AggregationFunction.MINMAX)])

step2 = AggrStep(aggr_type="EVENTS", ent_type= None, where=None, group_by=[log.event_activity, "Customer_Order"], attr_aggrs=[AttrAggr(name=f'{log.event_timestamp}', function=AggregationFunction.MINMAX)]) 

step3 = AggrStep(aggr_type="ENTITIES", ent_type= "Vehicle", 
        where='Departure_Date > datetime("2023-12-31T23:59:59")', group_by=[ekg.type_tag], attr_aggrs=[]) # I want to check all the orders after Easter

Performance:

Step #Init Events #Final Events #Init Entities #Final Entities Query Exec Time (s)
Step1 35413 35413 13888 11889 0.06797218323
Step2 35413 0 11889 11889 1.65262413
Step3 0 0 11889 11823 0.06576704979
Finalization 0 0 11823 0 0.1540901661
Rel Inference 0 0 0 0 0.5269031525

Tip

These aggregation steps are just examples. Thanks to the modular nature of the approach, you can combine and adapt them to construct a variety of queries over entity and event data.

Clone this wiki locally