Skip to main content
Looking for usage documentation? Check out Relational predictions.
A relational database: its named table sources and their schema. Carries no val/test timestamps — those define an evaluation split, not the data, and enter at build_dataset / UserDataset (mirroring RelBench’s Database vs Dataset split).
Fields

DatabaseSpec.from_yaml

View source
Load a database schema from a YAML file (table name -> its schema). Each table’s data file is its path if given; relative paths and the default <name>.parquet resolve against data_dir, or the YAML’s own directory if data_dir is omitted - so the schema stays portable and materialize_relbench can supply the files.
Parameters
Returns

PredictiveTaskSpec

View source
One training task: label SQL and temporal evaluation splits. The query is a DuckDB statement that joins timestamp_df (a single column timestamp holding the anchor times) against the database tables - referenced by their names - and returns exactly time_col, entity_col and target_col, computing the label over the forward window (t, t + timedelta]. The literal {timedelta} in the query is replaced with the string form of timedelta, e.g. INTERVAL "{timedelta}". val_timestamp / test_timestamp are the tuning and final split cutoffs. The database schema lives separately in a DatabaseSpec. task_type accepts the RelBench enum or the strings "binary_classification" / "regression"; timedelta accepts a pandas.Timedelta or anything it can parse.
Fields