paddlenlp/metrics/glue.py
def accumulate(self):
        """
        Calculates and returns the accumulated metric.

        Returns:
            tuple: Returns the accumulated metric, a tuple of shape (mcc,), `mcc` is the accumulated mcc and its data
            type is float64.

        """
        if self.tp == 0 or self.fp == 0 or self.tn == 0 or self.fn == 0:
            mcc = 0.0
        else:
            # mcc = (tp*tn-fp*fn)/ sqrt(tp+fp)(tp+fn)(tn+fp)(tn+fn))
            mcc = (self.tp * self.tn - self.fp * self.fn) / math.sqrt(
                (self.tp + self.fp) * (self.tp + self.fn) *
                (self.tn + self.fp) * (self.tn + self.fn))
        return (mcc, )

        Calculates and returns the accumulated metric.

        Returns:
            tuple: Returns the accumulated metric, a tuple of shape (mcc,), `mcc` is the accumulated mcc and its data
            type is float64.

        
Calculates and returns the accumulated metric.
Calculates and returns the accumulated metric .
def accumulate(self):
        if self.tp == 0 or self.fp == 0 or self.tn == 0 or self.fn == 0:
            mcc = 0.0
        else:
            mcc = (self.tp * self.tn - self.fp * self.fn) / math.sqrt(
                (self.tp + self.fp) * (self.tp + self.fn) *
                (self.tn + self.fp) * (self.tn + self.fn))
        return (mcc, )
def accumulate ( self ) : if self . tp == 0 or self . fp == 0 or self . tn == 0 or self . fn == 0 : mcc = 0.0 else : mcc = ( self . tp * self . tn - self . fp * self . fn ) / math . sqrt ( ( self . tp + self . fp ) * ( self . tp + self . fn ) * ( self . tn + self . fp ) * ( self . tn + self . fn ) ) return ( mcc , )
Calculates and returns the accumulated metric.
Calculates and returns the accumulated metric .
"""
        Calculates and returns the accumulated metric.

        Returns:
            tuple: Returns the accumulated metric, a tuple of shape (mcc,), `mcc` is the accumulated mcc and its data
            type is float64.

        """ # mcc = (tp*tn-fp*fn)/ sqrt(tp+fp)(tp+fn)(tn+fp)(tn+fn))
Returns the accumulated metric, a tuple of shape (mcc,), `mcc` is the accumulated mcc and its data
type is float64.
Returns the accumulated metric a tuple of shape ( mcc ) ` mcc ` is the accumulated mcc and its data type is float64 .
tuple
self