dataeval.utils.data.validate_dataset¶
-
dataeval.utils.data.validate_dataset(dataset, *, expected=
'any_target', arg_name='dataset', caller=None)¶ Validate that a dataset matches the expected MAITE datum shape.
- Parameters:¶
- dataset : Any¶
The object passed in as the dataset. Must be
Sizedand indexable by integer.- expected=
'any_target'¶ The shape the caller intends to consume. See
DatasetKind.- arg_name=
'dataset'¶ The parameter name to use in error messages.
- caller : str, optional¶
Name of the calling function/class — included in error messages for easier debugging. When
None, the caller is inferred from the stack.
- Returns:¶
The inferred concrete kind. For
expected == "any_target"this will be one of"classification" | "object_detection" | "segmentation"; for other inputs it echoesexpected.- Return type:¶
DatasetKind
- Raises:¶
MaiteShapeError – If the dataset is empty, non-indexable, or its datum shape does not satisfy
expected.