# `Imp.Datasets`
[🔗](https://github.com/deepfates/imp/blob/v0.18.1/lib/imp/datasets.ex#L1)

Local dataset loaders for examples, JSONL, CSV, GSM8K, HotPotQA, MATH, and
Colors records.

Named loaders accept an existing local path; they do not download datasets.
Source-checkout benchmark fixtures are fetched explicitly with the
`imp.benchmark.fetch` Mix task.

# `csv`

Loads examples from a CSV file whose first record is the header.

The file is read as RFC 4180 CSV: a quoted field may contain commas,
doubled quotes and line breaks. A line break is CRLF, LF or a bare CR, a
leading byte order mark is dropped, and blank lines are skipped. Each record becomes
a map from the header's strings to the record's fields. A file that is not
valid CSV, or a record whose field count differs from the header's, raises
`Imp.Datasets.Error` naming the line the record starts on, with the start
of the record that could not be read.

# `from_records`

# `gsm8k`

# `hotpotqa`

# `jsonl`

# `split`

Splits examples into `{train, rest}` at the `:train` fraction (default `0.8`).

With `shuffle: true` (the default) the examples are shuffled with a seeded
RNG before splitting. The shuffle is deterministic: the same examples and
the same `:seed` (default `0`) always produce the same split, so downstream
consumers such as `Imp.Optimizer.LabeledFewShot` see the same trainset on
every run. Pass a different `seed:` for a different permutation, or
`shuffle: false` to preserve input order.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
