dataeval.data.merge_datasets

dataeval.data.merge_datasets(*datasets)

Concatenate datasets that share a label vocabulary into one dataset view.

Returns a lazy, read-only AnnotatedDataset that indexes through the given datasets in order. All datasets must already share the same index2label so their integer labels denote the same classes — use dataeval.data.View with dataeval.data.Relabel to conform datasets to a common reference vocabulary first. Datasets must also share a compatible datum shape (e.g. all MAITE (input, target, metadata) triples); merging structurally different datums is not supported.

Parameters:
*datasets : AnnotatedDataset

Two or more datasets to merge. Each should expose an index2label in its metadata; when present, all must be equal.

Returns:

A concatenated view whose metadata carries the shared index2label.

Return type:

AnnotatedDataset

Raises:

ValueError – If no datasets are given, or their index2label mappings differ, or some datasets expose an index2label while others do not.

Warns:

UserWarning – If none of the datasets expose an index2label (the label spaces cannot be verified to match, so equality is vacuous), or if the datasets have an obviously inconsistent datum shape (e.g. differing tuple arity).

See also

dataeval.data.View

Build a dataset view (e.g. relabel to a reference vocabulary).