def score(self, embeddings: Array) -> Array:
        """
        The confidence score :math:`M(\mathbf{x})` for a new test sample :math:`\mathbf{x}` is obtained computing
        the max (squared) Mahalanobis distance between :math:`f(\mathbf{x})` and the fitted class-wise Guassians.

        A high score signals that the test sample :math:`\mathbf{x}` is identified as OOD.

        Parameters
        ----------
        embeddings: Array
            The embeddings of shape `(n, d)` where `n` is the number of test samples and `d` is the embbeding's size.

        Returns
        -------
        Array
            An array of scores with length `n`.
        """
        if self._mean is None or self._cov is None:
            raise NotFittedError("You have to call fit before calling score.")
        return compute_mahalanobis_distance(embeddings, self.mean, self.cov).min(axis=1)

        The confidence score :math:`M(\mathbf{x})` for a new test sample :math:`\mathbf{x}` is obtained computing
        the max (squared) Mahalanobis distance between :math:`f(\mathbf{x})` and the fitted class-wise Guassians.

        A high score signals that the test sample :math:`\mathbf{x}` is identified as OOD.

        Parameters
        ----------
        embeddings: Array
            The embeddings of shape `(n, d)` where `n` is the number of test samples and `d` is the embbeding's size.

        Returns
        -------
        Array
            An array of scores with length `n`.
        
fortuna/ood_detection/mahalanobis.py