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

# Tabular regression

> Dataset template for tabular regression: one CSV with features and a numeric target, the typed schema, the required label policy, ingest.yaml and the checks the data ingestor runs.

Predict a number from table columns. The dataset is a single CSV with a header row: feature columns plus one numeric target column. Because the target is a raw numeric value, the `label` must declare a **policy** that keeps raw targets inside your secure environment.

## Folder layout

```text theme={null}
/data/shared/house-prices/
└── houses.csv
```

* One CSV, UTF-8, comma-separated, with a header row. With the CLI, an Excel workbook, a semicolon CSV with decimal commas, or a Latin-1 CSV works too: the copy converts it, and your file stays as it is.
* Feature columns are numeric or typed text; the target column holds a continuous number.

## Data CSV

```csv theme={null}
id,square_feet,bedrooms,age,price
1,1668.08,3,15,285.50
2,1701.78,4,12,320.75
3,1697.01,2,8,245.30
```

| Column | Meaning |
| - | - |
| feature columns | Declared in `schema` with their SQL type and stored. |
| target column (`price` here) | Named by `label.column`; **not** declared in `schema`. |
| `id` | Optional; cannot be declared in `schema` (reserved). Use `data_id: {strategy: column, column: id}` to keep it as the row id. |

## Ingest with the CLI

Pass the CSV file, or a folder that holds only that CSV. Ingest the training and the test split separately:

```bash theme={null}
tracebloc data ingest ./houses_train.csv --task tabular_regression --name house_prices_train --intent train --label-column price --label-policy bucket --holds open_data
tracebloc data ingest ./houses_test.csv  --task tabular_regression --name house_prices_test  --intent test  --label-column price --label-policy bucket --holds open_data
```

`--holds open_data` marks the dataset as open data. If your data is about patients, pass `--holds patient_data`; if it was generated, pass `--holds synthetic_data`. Leave `--holds` out on a terminal and the CLI asks; in a script, the dataset is marked as patient data. The mark decides which [use case types](https://docs.tracebloc.io/create-use-case/define.md#step-2-data-&-evaluation) you can create on the dataset.

`--label-policy bucket` is the default; it is shown here to make the policy explicit. The CLI infers a SQL type for every column, so `--schema` is optional. To set the types yourself, pass `--schema 'col:TYPE,col:TYPE'` and quote it, because a type such as `VARCHAR(64)` contains shell characters. `--schema` replaces the inferred schema: list every feature column you want stored, not just the ones you retype. Including the label column in `--schema` is fine: the ingestor drops it from the stored schema. The CLI skips a reserved column such as `id`.

## ingest.yaml

```yaml theme={null}
apiVersion: tracebloc.io/v1
kind: IngestConfig
category: tabular_regression
table: house_prices_train
intent: train
csv: /data/shared/house-prices/houses.csv
schema:
  square_feet: FLOAT
  bedrooms: INT
  age: INT
label:
  column: price
  policy: bucket
```

| Field | Required | Meaning |
| - | - | - |
| `csv` | yes | Path to the data CSV. |
| `schema` | **yes** (with the CLI, inferred for you) | Column name to SQL type for the feature columns. Every schema column must exist in the CSV. |
| `label` | **yes, object form** | `column` names the target; `policy` is required. `bucket` sends the platform one of 64 stable hash buckets per value instead of the raw number — the stored rows keep the raw target for training. `passthrough` sends raw values; use it only with a compliance sign-off. |
| `columns` | no | Per-column `unit` (for example `USD`) and `ordinal` facts. |
| `data_id`, `spec.csv_options` | no | See [the contract](https://docs.tracebloc.io/create-use-case/templates.md#the-ingest-yaml-contract). |

## What the ingestor checks

| Check | Rejects |
| - | - |
| Data types | Duplicate header names; a schema column missing from the CSV; any value that does not fit its declared type; unknown SQL types. |

Plus the [checks every ingest runs](https://docs.tracebloc.io/create-use-case/templates.md#checks-every-ingest-runs). There is no label-diversity check: a continuous target has no classes.

## Sample dataset

The template ships a synthetic housing CSV with `id`, `square_feet` (`FLOAT`), `bedrooms` (`INT`), `age` (`INT`) and the target `price` — the rows shown above are its first rows. The `ingest.yaml` above ingests it as is; only `csv:` changes to wherever you staged the file.

## Model settings for this dataset

When you link a model, the platform checks `num_feature_points` against the dataset (see [model parameters by task](https://docs.tracebloc.io/join-use-case/start-training.md#model-parameters-by-task)). It must equal the number of stored feature columns: every column except the target and reserved columns such as `id`. For the sample, that is 3. The model-zoo templates default to 10, 17 or 50, so edit it. `output_classes` is not checked for regression. Feature columns reach the model sorted by column name, whatever order the CSV or `schema` uses.

Until the next engine release, training and evaluation report R² under **accuracy** for regression. Read that value as R², not as a share of correct predictions.

## Next steps

* Ingest the data: [Prepare Data](https://docs.tracebloc.io/create-use-case/prepare-dataset.md)
* Shared rules for every template: [Dataset templates](https://docs.tracebloc.io/create-use-case/templates.md)


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