End-to-End Examples
These examples show complete graph construction, execution, and output inspection. Start with the smallest example that matches your goal.
Learn the core workflow
| Example | What it demonstrates | Backend |
|---|---|---|
| Hello World | Parent grain, two child relations, automatic features, and labels | pandas |
| Preserve child grain | The effect of reduce=False |
pandas, DuckDB |
| All tables with labels | A deeper graph with complete reduction and ML targets | pandas, DuckDB |
Compare backends and custom logic
| Example | What it demonstrates |
|---|---|
| Same graph, multiple backends | Equivalent customer/notification logic across pandas, SQLite, DuckDB, PySpark, Snowflake, and Databricks SQL |
| Custom pandas graph | Explicit node operations across all sample tables |
| Custom DuckDB graph | SQL-native custom operations across all sample tables |
| Custom PySpark graph | Distributed dataframe operations across all sample tables |
Continue into modeling
| Example | Model |
|---|---|
| Predictive AI with XGBoost | XGBClassifier on GraphReduce features |
| Predictive AI with TabPFN | TabPFNClassifier on GraphReduce features |
RelBench tasks
The performance comparison summarizes the available RelBench runs. Individual task pages provide the corresponding materialization and evaluation entry points.
Classification:
- rel-stack: user badges
- rel-stack: user engagement
- rel-trial: study outcome
- rel-hm: user churn
- rel-avito: user clicks
- rel-avito: user visits
- rel-amazon: user churn
- rel-amazon: item churn
Regression:
- rel-stack: post votes
- rel-avito: ad CTR
- rel-hm: item sales
- rel-amazon: user LTV
- rel-amazon: item LTV
For smaller SQL building blocks, use the SQL backends guide before these full examples.