> ## Documentation Index
> Fetch the complete documentation index at: https://docs.priorlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> TabPFN-3 and later versions support up to 1,000,000 rows, subject to feature count and checkpoint/API limits.
> For large datasets, use per-estimator subsampling, e.g. inference_config={"SUBSAMPLE_SAMPLES": 100_000}, in TabPFNClassifier or TabPFNRegressor from tabpfn or tabpfn_client.
> Pass raw pandas DataFrames to fit and predict. Categorical strings/categories, raw text, and missing feature values are handled automatically; no manual integer/one-hot encoding, imputation, scaling, or outlier removal is needed.

# Database and task specifications

> Database and task specifications for TabPFN-Rel.

> [!NOTE]
>
> Looking for usage documentation? Check out [Relational predictions](https://docs.priorlabs.ai/capabilities/relational.md).

## `DatabaseSpec`

[ View source ](https://github.com/PriorLabs/relarena/blob/4b74c718ba6ff9c67cf63b4beac6dadaffdd09d8/packages/relarena-core/src/relarena_core/userdb/ingest.py#L41)

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).

```python theme={null}
DatabaseSpec(
    tables: dict[str, TableSource],
)
```

**Fields**

| Name | Type | Default | Description |
| - | - | - | - |
| `tables` | `dict[str, TableSource]` | Required | — |

***

## `DatabaseSpec.from_yaml`

[ View source ](https://github.com/PriorLabs/relarena/blob/4b74c718ba6ff9c67cf63b4beac6dadaffdd09d8/packages/relarena-core/src/relarena_core/userdb/ingest.py#L52)

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.

```python theme={null}
DatabaseSpec.from_yaml(
    path: str,
    *,
    data_dir: str | None = None,
) -> DatabaseSpec
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `path` | `str` | Required | — |
| `data_dir` | `str \| None` | `None` | — |

**Returns**

| Type | Description |
| - | - |
| `DatabaseSpec` | — |

***

## `PredictiveTaskSpec`

[ View source ](https://github.com/PriorLabs/relarena/blob/4b74c718ba6ff9c67cf63b4beac6dadaffdd09d8/packages/relarena-core/src/relarena_core/userdb/spec.py#L18)

One training task: label SQL and temporal evaluation splits.

The [`query`](https://docs.priorlabs.ai/api-reference/python/relarena-core/specifications#predictivetaskspec--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`](https://docs.priorlabs.ai/api-reference/python/relarena-core/specifications#predictivetaskspec--time-col), [`entity_col`](https://docs.priorlabs.ai/api-reference/python/relarena-core/specifications#predictivetaskspec--entity-col) and [`target_col`](https://docs.priorlabs.ai/api-reference/python/relarena-core/specifications#predictivetaskspec--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`](https://docs.priorlabs.ai/api-reference/python/relarena-core/specifications#predictivetaskspec--timedelta), e.g.
`INTERVAL "{timedelta}"`.

[`val_timestamp`](https://docs.priorlabs.ai/api-reference/python/relarena-core/specifications#predictivetaskspec--val-timestamp) / [`test_timestamp`](https://docs.priorlabs.ai/api-reference/python/relarena-core/specifications#predictivetaskspec--test-timestamp) are the tuning and final split cutoffs.
The database schema lives separately in a [`DatabaseSpec`](https://docs.priorlabs.ai/api-reference/python/relarena-core/specifications#databasespec).

[`task_type`](https://docs.priorlabs.ai/api-reference/python/relarena-core/specifications#predictivetaskspec--task-type) accepts the RelBench enum or the strings `"binary_classification"` /
`"regression"`; [`timedelta`](https://docs.priorlabs.ai/api-reference/python/relarena-core/specifications#predictivetaskspec--timedelta) accepts a `pandas.Timedelta` or anything it can parse.

```python theme={null}
PredictiveTaskSpec(
    entity_table: str,
    entity_col: str,
    time_col: str,
    target_col: str,
    task_type: TaskType,
    timedelta: pd.Timedelta,
    query: str,
    val_timestamp: pd.Timestamp,
    test_timestamp: pd.Timestamp,
    num_eval_timestamps: int = 1,
)
```

**Fields**

| Name | Type | Default | Description |
| - | - | - | - |
| `entity_table` | `str` | Required | — |
| `entity_col` | `str` | Required | — |
| `time_col` | `str` | Required | — |
| `target_col` | `str` | Required | — |
| `task_type` | `TaskType` | Required | — |
| `timedelta` | `pd.Timedelta` | Required | — |
| `query` | `str` | Required | — |
| `val_timestamp` | `pd.Timestamp` | Required | — |
| `test_timestamp` | `pd.Timestamp` | Required | — |
| `num_eval_timestamps` | `int` | `1` | — |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.