trl-rbench / docs /schema.md
weipang142857's picture
add rbench schema docs
2e179df verified
# `logo-lab/rbench` per-config schema reference
## `row_prediction` (mirrored parquet)
Each of the 50 OpenML tables lives under `data/row_prediction/openml_<id>/`
with three split files (`train-*.parquet`, `validation-*.parquet`,
`test-*.parquet`) and a `dataset.json` sidecar.
### Per-row schema
| Column | Type | Notes |
|---|---|---|
| `row_id` | int64 | original OpenML row index |
| `<col_name>` | (table-specific) | one column per OpenML feature **and** per target, with the OpenML column name preserved verbatim (no `feature_`/`target_` prefix). The `dataset.json` sidecar lists which columns are features and which are targets. Types are preserved from OpenML. |
### Per-table sidecar (`dataset.json`)
```json
{
"openml_id": 3,
"name": "kr-vs-kp",
"openml_url": "https://www.openml.org/d/3",
"openml_license": "Public Domain",
"n_rows": 3196,
"n_features": 36,
"feature_columns": ["bkblk", "bknwy", ...],
"target_columns": [
{"name": "label", "task_type": "classification", "n_classes": 2}
],
"splits": {
"train_idx": [...],
"validation_idx": [...],
"test_idx": [...]
},
"trl_bench_curation": {
"selected_at": "2026-...",
"label_repairs": [],
"removed_targets": []
}
}
```
The `dataset.json` is loaded by `dataset_info.json`-like helpers but is
intentionally also a plain `.json` so users can read it without a special
loader.
## `record_linkage` (loading script)
### Per-row schema
| Column | Type | Notes |
|---|---|---|
| `pair_id` | string | `f"{source}/{split}/{idx}"` |
| `left_table` | string | JSON-encoded record dict (label-equivalent columns already removed) |
| `right_table` | string | same |
| `label` | ClassLabel({"non_match": 0, "match": 1}) | binary match label |
| `source` | string | e.g., `deepmatcher_beer`, `wdc_products_xlarge` |
| `family` | string | `deepmatcher_clean` / `deepmatcher_dirty` / `wdc_products` |
| `split` | string | `train` / `validation` / `test` (matches HF SplitGenerator names; the upstream `valid.csv` file is mapped onto the `validation` split at load time) |
### Sub-configs
When loaded with the umbrella `record_linkage` config, the dataset is the
union of all 16 sources (with the `source` column distinguishing them).
Sub-configs `record_linkage_<source>` return only that source.
### Label-equivalent column removal (per paper appendix J)
Applied at load time, deterministic:
- WDC tables: drop `cluster_id` and `identifiers`
- Fodors-Zagats: drop `class`
These removals are baked into the loading script; users always see the
label-leakage-free view.
### Splits
Pair-disjoint splits inherited from upstream:
- DeepMatcher: 3:1:1 train/valid/test (per source's `train.csv`/`valid.csv`/`test.csv`)
- WDC LSPM v2: pre-split per WDC release