dataeval.data.Metadata

class dataeval.data.Metadata(dataset, *, continuous_factor_bins=None, auto_bin_method='uniform_width', exclude=None, include=None)

Class containing binned metadata.

discrete_factor_names

List containing factor names for the original data that was discrete and the binned continuous data

Type:

list[str]

Return type:

list[str]

discrete_data

Array containing values for the original data that was discrete and the binned continuous data

Type:

NDArray[np.int64]

Return type:

numpy.typing.NDArray[numpy.int64]

continuous_factor_names

List containing factor names for the original continuous data

Type:

list[str]

Return type:

list[str]

continuous_data

Array containing values for the original continuous data or None if there was no continuous data

Type:

NDArray[np.float64] | None

Return type:

numpy.typing.NDArray[numpy.float64]

class_labels

Numerical class labels for the images/objects

Type:

NDArray[np.int]

Return type:

numpy.typing.NDArray[numpy.intp]

class_names

List of unique class names

Type:

list[str]

Return type:

list[str]

total_num_factors

Sum of discrete_factor_names and continuous_factor_names plus 1 for class

Type:

int

Return type:

int

image_indices

Array of the image index that is mapped by the index of the factor

Type:

NDArray[np.intp]

Return type:

numpy.typing.NDArray[numpy.intp]

Parameters:
dataset : ImageClassificationDataset or ObjectDetectionDataset

Dataset to access original targets and metadata from.

continuous_factor_bins : Mapping[str, int | Sequence[float]] | None, default None

Mapping from continuous factor name to the number of bins or bin edges

auto_bin_method : Literal["uniform_width", "uniform_count", "clusters"], default "uniform_width"

Method for automatically determining the number of bins for continuous factors

exclude : Sequence[str] | None, default None

Filter metadata factors to exclude the specified factors, cannot be set with include

include : Sequence[str] | None, default None

Filter metadata factors to include the specified factors, cannot be set with exclude

add_factors(factors)

Add additional factors to the metadata.

The number of measures per factor must match the number of images in the dataset or the number of detections in the dataset.

Parameters:
factors : Mapping[str, ArrayLike]

Dictionary of factors to add to the metadata.

Return type:

None