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
AnnotatedDatasetthat indexes through the given datasets in order. All datasets must already share the sameindex2labelso their integer labels denote the same classes — usedataeval.data.Viewwithdataeval.data.Relabelto 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
index2labelin its metadata; when present, all must be equal.
- Returns:¶
A concatenated view whose
metadatacarries the sharedindex2label.- Return type:¶
- Raises:¶
ValueError – If no datasets are given, or their
index2labelmappings differ, or some datasets expose anindex2labelwhile 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.ViewBuild a dataset view (e.g. relabel to a reference vocabulary).