(self, labels, pred_scores)
Compute AUC for binary classification.

        Parameters
        ----------
        labels: value list. The labels of data set.
        pred_scores: value list. The predict results of model. It should be corresponding to labels each data.

        Returns
        ----------
        float
            The AUC
Compute AUC for binary classification.
Compute AUC for binary classification .
def auc(self, labels, pred_scores):
        """
        Compute AUC for binary classification.

        Parameters
        ----------
        labels: value list. The labels of data set.
        pred_scores: value list. The predict results of model. It should be corresponding to labels each data.

        Returns
        ----------
        float
            The AUC
        """
        if self.eval_type == consts.BINARY:
            return roc_auc_score(labels, pred_scores)
        elif self.eval_type == consts.ONE_VS_REST:
            try:
                score = roc_auc_score(labels, pred_scores)
            except:
                score = 0  # in case all labels are 0 or 1
                logging.warning("all true labels are 0/1 when running ovr AUC")
            return score
        else:
            logging.warning("auc is just suppose Binary Classification! return None as results")
            return None
def auc ( self , labels , pred_scores ) : if self . eval_type == consts . BINARY : return roc_auc_score ( labels , pred_scores ) elif self . eval_type == consts . ONE_VS_REST : try : score = roc_auc_score ( labels , pred_scores ) except : score = 0 # in case all labels are 0 or 1 logging . warning ( "all true labels are 0/1 when running ovr AUC" ) return score else : logging . warning ( "auc is just suppose Binary Classification! return None as results" ) return None