bias#

Bias metrics check for skewed or imbalanced datasets and incomplete feature representation which may impact model performance.

Metric Functions#

balance(class_labels, metadata[, num_neighbors])

Mutual information (MI) between factors (class label, metadata, label/image properties)

coverage(embeddings[, radius_type, k, percent])

Class for evaluating coverage and identifying images/samples that are in undercovered regions.

diversity(class_labels, metadata[, method])

Compute diversity and classwise diversity for discrete/categorical variables and, through standard histogram binning, for continuous variables.

label_parity(expected_labels, observed_labels)

Calculate the chi-square statistic to assess the parity between expected and observed label distributions.

parity(class_labels, data_factors[, ...])

Calculate chi-square statistics to assess the relationship between multiple factors and class labels.

Output Classes#

BalanceOutput(balance, factors, classwise)

Output class for balance() bias metric

CoverageOutput(indices, radii, critical_value)

Output class for coverage() bias metric

DiversityOutput(diversity_index, classwise)

Output class for diversity() bias metric

ParityOutput(score, p_value)

Output class for parity() and label_parity() bias metrics