(self)
return prec
Precision curve

        The last element represents precision at threshold 1. Unless such
        a probability appears in the data, the precision at this point is
        undefined. To avoid this, we copy the previous value to the last.
Precision curve
Precision curve
def precision(self):
        """
        Precision curve

        The last element represents precision at threshold 1. Unless such
        a probability appears in the data, the precision at this point is
        undefined. To avoid this, we copy the previous value to the last.
        """
        tp_fp = np.arange(self.tot, -1, -1)
        tp_fp[-1] = 1  # avoid division by zero
        prec = self.tp / tp_fp
        prec[-1] = prec[-2]
        return prec
def precision ( self ) : tp_fp = np . arange ( self . tot , - 1 , - 1 ) tp_fp [ - 1 ] = 1 # avoid division by zero prec = self . tp / tp_fp prec [ - 1 ] = prec [ - 2 ] return prec