dataeval.metrics.bias.DiversityOutput

class dataeval.metrics.bias.DiversityOutput

Output class for diversity() bias metric.

diversity_index

Diversity index for classes and factors

Type:

NDArray[np.double]

classwise

Classwise diversity index [n_class x n_factor]

Type:

NDArray[np.double]

factor_names

Names of each metadata factor

Type:

list[str]

class_list

Class labels for each value in the dataset

Type:

NDArray[Any]

dict()

Output attributes as a dictionary.

Return type:

dict[str, Any]

meta()

Execution metadata as a dictionary.

Return type:

dict[str, Any]

plot(row_labels=None, col_labels=None, plot_classwise=False)

Plot a heatmap of diversity information

Parameters:
row_labels : ArrayLike or None, default None

List/Array containing the labels for rows in the histogram

col_labels : ArrayLike or None, default None

List/Array containing the labels for columns in the histogram

plot_classwise : bool, default False

Whether to plot per-class balance instead of global balance

Return type:

matplotlib.figure.Figure