API Reference / datasets / builtin /

catalog.py

Catalog of the datasets bundled with TuiML.

Holds DATASET_REGISTRY, the metadata table describing every built-in dataset, plus the functions that read it (get_dataset_info, get_datasets_by_task) and the name-based loaders that work for any dataset in the catalog (list_datasets, load_dataset).

Each registry entry records the task type, shape, and a one-line description, which makes the catalog directly usable as context for an LLM deciding which dataset to reach for. The per-dataset convenience loaders (load_iris and friends) live in the sibling classification, regression, and other modules.

python
>>> from tuiml.datasets import list_datasets, load_dataset, get_datasets_by_task
>>> list_datasets("regression")
['airline', 'cpu', 'cpu_with_vendor']
>>> data = load_dataset("iris")
>>> sorted(get_datasets_by_task("association"))
['supermarket']

Functions

Func

get_dataset_info

Line 136
get_dataset_info(name: str=None) -> dict

Get metadata about built-in datasets in an LLM-friendly format.

Parameters

name
str or None = None
The name of a specific dataset (e.g., "iris"). If None, metadata for all registered datasets will be returned.

Returns

dict
A dictionary containing metadata such as task type, sample count, feature count, class count, and description.

Raises

ValueError
If name is not a registered dataset.
python
>>> from tuiml.datasets import get_dataset_info
>>> info = get_dataset_info("diabetes")
>>> print(info["samples"])
768
Func

get_datasets_by_task

Line 170
get_datasets_by_task(task: str) -> dict

Get datasets filtered by task type (LLM-friendly).

Parameters

task
str
Task type: "classification", "regression", "association", "text_classification"

Returns

dict
Filtered dataset registry.
python
>>> from tuiml.datasets import get_datasets_by_task
>>> get_datasets_by_task("classification")
>>> get_datasets_by_task("regression")
Func

list_datasets

Line 195
list_datasets(category: Optional[str]=None) -> List[str]

List names of all available built-in datasets.

Parameters

category
str or None = None

Optional filter to restrict results to a specific category:

  • "classification"
  • "regression"
  • "other" (Association, Text, etc.)

Returns

List[str]
Alphabetical list of dataset names.

Raises

ValueError
If category is not one of the three known categories.
python
>>> from tuiml.datasets import list_datasets
>>> available = list_datasets("regression")
>>> print(available)
['airline', 'cpu', 'cpu_with_vendor']
Func

load_dataset

Line 236
load_dataset(name: str) -> Dataset

Load a built-in dataset by its registry name.

Automatically identifies the correct file path and uses the ARFF loader to return a standardized Dataset object.

Parameters

name
str
The name of the dataset to load (e.g., 'iris', 'diabetes', 'cpu').

Returns

Dataset
Standardized dataset object containing the data and metadata.

Raises

ValueError
If no bundled dataset matches name.
python
>>> from tuiml.datasets import load_dataset
>>> iris = load_dataset('iris')
>>> X, y = iris