API Reference / datasets /

loaders/

Reading and writing datasets, in whatever format they arrive.

Every loader returns the same DatasetX, y and feature names — so the rest of TuiML never has to care where the data came from. Each format also has a matching save_*.

Formats

  • CSV / TSV: load_csv, save_csv.
  • ARFF: load_arff, save_arff. A typed text format that
carries column types and nominal values in its header.
  • Parquet: load_parquet, save_parquet, plus
load_parquet_partitioned for directory-partitioned datasets.
  • Excel: load_excel, save_excel, and
load_excel_sheets for a workbook of several sheets.
  • JSON: load_json, load_jsonl, load_json_nested
for records that are not flat, and their save_* counterparts.
  • NumPy: load_numpy, save_numpy (.npy / .npz).
  • pandas: from_pandas, to_pandas for in-memory frames.

Detecting the format

load and save pick the right one from the file extension, so a path is usually all you need. This is what lets {"source": "sales.csv"} work in a train spec.
python
>>> from tuiml.datasets.loaders import load
>>> data = load("sales.csv", target="label")     # doctest: +SKIP
>>> data.X.shape                                 # doctest: +SKIP
(1000, 12)

Modules