dataeval.core.ber_mst

dataeval.core.ber_mst(embeddings, class_labels)

An estimator for Multi-class Bayes error rate using FR with a minimum spanning tree (MST) test statistic basis.

Parameters:
embeddings : ArrayND[float]

Array of image embeddings. Can be an N dimensional list, or array-like object.

class_labels : Array1D[int]

Array of class labels for each image. Can be a 1D list, or array-like object.

Returns:

Mapping with keys:

  • upper_bound: float - The upper bound of the Bayes Error Rate

  • lower_bound: float - The lower bound of the Bayes Error Rate

Return type:

BERResult

References

[1] Learning to Bound the Multi-class Bayes Error (Th. 3 and Th. 4)

Examples

>>> import sklearn.datasets as dsets
>>> from dataeval.core import ber_mst
>>> images, labels = dsets.make_blobs(n_samples=50, centers=2, n_features=2, random_state=0)
>>> ber_mst(images, labels)
{'upper_bound': 0.02, 'lower_bound': 0.010102051443364402}