dataeval.metrics.estimators.ber =============================== .. py:function:: dataeval.metrics.estimators.ber(images, labels, k = 1, method = 'KNN') An estimator for Multi-class :term:`Bayes error rate` using FR or KNN test statistic basis :param images: Array of images or image :term:`embeddings` :type images: ArrayLike (N, ... ) :param labels: Array of labels for each image or image embedding :type labels: ArrayLike (N, 1) :param k: Number of nearest neighbors for KNN estimator -- ignored by MST estimator :type k: int, default 1 :param method: Method to use when estimating the Bayes error rate :type method: Literal["KNN", "MST"], default "KNN" :returns: The upper and lower bounds of the Bayes Error Rate :rtype: BEROutput .. rubric:: References [1] `Learning to Bound the Multi-class Bayes Error (Th. 3 and Th. 4) `_ .. rubric:: Examples >>> import sklearn.datasets as dsets >>> from dataeval.metrics.estimators import ber >>> images, labels = dsets.make_blobs(n_samples=50, centers=2, n_features=2, random_state=0) >>> ber(images, labels) BEROutput(ber=0.04, ber_lower=0.020416847668728033)