Fundamentals
GraphReduce treats relational feature engineering as graph execution. The graph makes three decisions explicit:
- What does one output row represent? The
parent_nodedefines this grain. - How are tables related? Each edge records the key pair and whether the relation must be reduced.
- Which rows are valid at prediction time? Date keys and graph-level windows separate historical features from future labels.
A small example
If customers is the parent node, a bottom-up execution works like this:
- Reduce
order_productsto one row per order. - Join those features to
orders. - Reduce the enriched orders to one row per customer.
- Reduce notifications to one row per customer.
- Join both sets of customer-level features to
customers.
This ordering preserves information from deep relations while keeping the final table at customer grain.
The three objects
| Object | Represents | Owns |
|---|---|---|
GraphReduceNode |
A table, file, or queryable relation | Data access, filtering, annotation, normalization, reduction, labels |
| Entity edge | A parent/child relationship | Join keys, reduce, and reduce_after_join behavior |
GraphReduce |
The full compute graph | Parent grain, time windows, traversal, joins, and execution backend |
DynamicNode supplies default behavior for automatic feature engineering.
Subclass GraphReduceNode when a table needs custom logic. Use SQLNode or a
backend-specific subclass when operations should be compiled into SQL.
Four rules to remember
- Every node needs a unique
prefix. - Every time-varying node needs a
date_keyfor point-in-time filtering. - Use
reduce=Truefor a normal one-to-many child that must roll up to its parent. - Read the result from
graph.parent_node.dffor dataframe execution; SQL execution instead maintains backend references and generated statements.
Continue with: