DiversityOutput#

class dataeval.metrics.bias.DiversityOutput(diversity_index: ndarray[Any, dtype[float64]], classwise: ndarray[Any, dtype[float64]], class_list: ndarray[Any, dtype[Any]], metadata_names: list[str], method: Literal['shannon', 'simpson'])#

Output class for diversity() bias metric

diversity_index#

Diversity index for classes and factors

Type:

NDArray[np.float64]

classwise#

Classwise diversity index [n_class x n_factor]

Type:

NDArray[np.float64]

class_list#

Class labels for each value in the dataset

Type:

NDArray[np.int64]

metadata_names#

Names of each metadata factor

Type:

list[str]

plot(row_labels: list[Any] | ndarray[Any, dtype[Any]] | None = None, col_labels: list[Any] | ndarray[Any, dtype[Any]] | None = None, plot_classwise: bool = False) Figure#

Plot a heatmap of diversity information

Parameters:
  • row_labels (ArrayLike | None, default None) – List/Array containing the labels for rows in the histogram

  • col_labels (ArrayLike | 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