(self, labels, pred_scores, normalize=True)
Compute the accuracy
        Parameters
        ----------
        labels: value list. The labels of data set.
        pred_scores: pred_scores: value list. The predict results of model. It should be corresponding to labels each data.
        normalize: bool. If true, return the fraction of correctly classified samples, else returns the number of correctly classified samples
        Returns
        ----------
        dict
            the key is threshold and the value is the accuracy of this threshold.
Compute the accuracy
        Parameters
        ----------
        labels: value list. The labels of data set.
        pred_scores: pred_scores: value list. The predict results of model. It should be corresponding to labels each data.
        normalize: bool. If true, return the fraction of correctly classified samples, else returns the number of correctly classified samples
        Returns
        ----------
        dict
            the key is threshold and the value is the accuracy of this threshold.
Compute the accuracy Parameters ---------- labels : value list . The labels of data set . pred_scores : pred_scores : value list . The predict results of model . It should be corresponding to labels each data . normalize : bool . If true return the fraction of correctly classified samples else returns the number of correctly classified samples Returns ---------- dict the key is threshold and the value is the accuracy of this threshold .
def accuracy(self, labels, pred_scores, normalize=True):
        """
        Compute the accuracy
        Parameters
        ----------
        labels: value list. The labels of data set.
        pred_scores: pred_scores: value list. The predict results of model. It should be corresponding to labels each data.
        normalize: bool. If true, return the fraction of correctly classified samples, else returns the number of correctly classified samples
        Returns
        ----------
        dict
            the key is threshold and the value is the accuracy of this threshold.
        """

        if self.eval_type == consts.BINARY:
            acc_operator = classification_metric.BiClassAccuracy()
            acc_res, thresholds, cuts = acc_operator.compute(labels, pred_scores, normalize)
            return acc_res, cuts, thresholds
        elif self.eval_type == consts.MULTY:
            acc_operator = classification_metric.MultiClassAccuracy()
            return acc_operator.compute(labels, pred_scores, normalize)
        else:
            logging.warning("error:can not find classification type:".format(self.eval_type))
def accuracy ( self , labels , pred_scores , normalize = True ) : if self . eval_type == consts . BINARY : acc_operator = classification_metric . BiClassAccuracy ( ) acc_res , thresholds , cuts = acc_operator . compute ( labels , pred_scores , normalize ) return acc_res , cuts , thresholds elif self . eval_type == consts . MULTY : acc_operator = classification_metric . MultiClassAccuracy ( ) return acc_operator . compute ( labels , pred_scores , normalize ) else : logging . warning ( "error:can not find classification type:" . format ( self . eval_type ) )