> ## 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 classification

> Dataset template for tabular classification: one CSV with features and a class column, the typed schema, ingest.yaml and the checks the data ingestor runs.

Predict a class from table columns. The dataset is a single CSV with a header row: feature columns plus one class column. There are no per-sample files.

## Folder layout

```text theme={null}
/data/shared/churn/
└── customers.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.
* Every column has one consistent type. Feature columns are typically numeric; the class column may be text or integer codes.

## Data CSV

```csv theme={null}
id,feature_00,feature_01,feature_02,label
1,1.6680773978214032,-0.903902455,6.661496229171176,0
2,0.7017820066004041,1.9789541930566035,5.826137181850707,0
4,4.427524335645055,-1.543700586,6.2987092866052485,1
```

| Column | Meaning |
| - | - |
| feature columns | Declared in `schema` with their SQL type and stored as table columns. A column that is not in `schema` is not stored. |
| class column (`label` here) | Named by `label:`; **not** declared in `schema`. At least two distinct values are required. |
| `id` | Optional in your CSV, but it cannot be declared in `schema` (`id` is reserved). To use it as the row id, set `data_id: {strategy: column, column: id}` — only if it carries no personal data. |

In `schema` columns, empty cells and exactly the tokens `NA`, `N/A`, `n/a`, `NULL`, `null`, `None`, `none`, `NaN`, `nan`, `<NA>`, `#N/A` (case-sensitive) are stored as NULL.

## 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 ./customers_train.csv --task tabular_classification --name churn_train --intent train --label-column label --holds open_data
tracebloc data ingest ./customers_test.csv  --task tabular_classification --name churn_test  --intent test  --label-column label --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.

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_classification
table: churn_train
intent: train
csv: /data/shared/churn/customers.csv
schema:
  feature_00: FLOAT
  feature_01: FLOAT
  feature_02: FLOAT
label: label
```

| Field | Required | Meaning |
| - | - | - |
| `csv` | yes | Path to the data CSV. |
| `schema` | **yes** (with the CLI, inferred for you) | Column name to SQL type for every feature column you want stored. Every schema column must exist in the CSV header. See [SQL types](https://docs.tracebloc.io/create-use-case/templates.md#sql-types-for-schema). |
| `label` | yes | Name of the class column. String shorthand is fine; the value is sent to the platform as is. |
| `columns` | no | Per-column `unit` and `ordinal` facts for consistency checks across combined datasets. |
| `data_id` | no | Row id strategy; see [the contract](https://docs.tracebloc.io/create-use-case/templates.md#the-ingest-yaml-contract). |
| `spec.csv_options` | no | `delimiter`, `quotechar`, `escapechar`, `chunk_size`. |

## 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 (non-numeric in `INT`/`FLOAT`, over-long `VARCHAR`, `inf`, out-of-range integers, unparseable dates); unknown SQL type names. The whole file is scanned. |
| Label diversity | Fewer than two distinct label values (after whitespace stripping). |

Plus the [checks every ingest runs](https://docs.tracebloc.io/create-use-case/templates.md#checks-every-ingest-runs).

## Sample dataset

The template ships a synthetic CSV with `id`, three `FLOAT` features (`feature_00`, `feature_01`, `feature_02`) and a binary `label` column — the rows shown above are taken from it. 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 it against the dataset (see [model parameters by task](https://docs.tracebloc.io/join-use-case/start-training.md#model-parameters-by-task)):

* `num_feature_points` must equal the number of stored feature columns: every column except the label and reserved columns such as `id`. For the sample, that is 3.
* `output_classes` must equal the number of distinct labels. For the sample, that is 2.

Most model-zoo templates default to 50 features and 5 classes, so edit both. Feature columns reach the model sorted by column name, whatever order the CSV or `schema` uses.

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