Run Kumo Relational
Use sdm.models.KumoRelational to predict a target for task rows from the related tables they link to.
For what the model is and how it works, see Kumo Relational.
Describe Your Tables
A RelatedTables object has three parts:
tables: a name for each related table and itsTableTensor.relationships: key joins between tables. Single or composite keys.task_links: exactly one entry point from task rows into a related table.
Give key columns the id semantic type. They define relationships and are not used as features.
Example
This toy example predicts churn for two users from two labeled users and their orders.
With two labeled users, the probabilities only show that the pipeline runs. Real tasks need many more context rows.
Work with Real Data
For real datasets, use SDM’s subgraph samplers to build RelatedTables for each batch of task rows, with CPU (pyg-lib) or CUDA (cugraph) backends.
When two task rows refer to the same entity at different times, add a task ID to composite keys so each row only sees records available at its prediction time.
The RelBench example in the SDM repository shows this end to end. From that example’s directory, run:
Improve Accuracy
The model weights stay fixed, so accuracy depends on the choices you make at prediction time: which labeled rows go into the context, whether you average across several contexts, how the sampler selects related records, and how you turn the output into a decision. These notebooks tune each choice on a validation window and measure its lift on a later test window, using synthetic banking data across five related tables:
- Imbalanced classification, with fraud detection as the example. Covers rebalancing the context, ensembling contexts, sampling settings, and the decision threshold.
- Regression, with 30 day spend forecasting as the example. Covers context composition, ensembling contexts, sampling settings, and which output quantile to report.
Inputs and Limits
- Pass
related_context_tablesandrelated_query_tablestogether; the model requires related tables. - Exactly one task link to an entity table.
- Tables must be two-dimensional.
- One target column per call.
For GPU memory, system RAM, and disk planning, see the GPU Sizing Guide.