(self, labels, pred_scores)
Compute the precision
        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.
        thresholds: value list. This parameter effective only for 'binary'. The predict scores will be 1 if it larger than thresholds, if not,
                    if will be 0. If not only one threshold in it, it will return several results according to the thresholds. default None
        result_filter: value list. If result_filter is not None, it will filter the label results not in result_filter.
        Returns
        ----------
        dict
            The key is threshold and the value is another dic, which key is label in parameter labels, and value is the label's precision.
Compute the precision
        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.
        thresholds: value list. This parameter effective only for 'binary'. The predict scores will be 1 if it larger than thresholds, if not,
                    if will be 0. If not only one threshold in it, it will return several results according to the thresholds. default None
        result_filter: value list. If result_filter is not None, it will filter the label results not in result_filter.
        Returns
        ----------
        dict
            The key is threshold and the value is another dic, which key is label in parameter labels, and value is the label's precision.
Compute the precision 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 . thresholds : value list . This parameter effective only for binary . The predict scores will be 1 if it larger than thresholds if not if will be 0 . If not only one threshold in it it will return several results according to the thresholds . default None result_filter : value list . If result_filter is not None it will filter the label results not in result_filter . Returns ---------- dict The key is threshold and the value is another dic which key is label in parameter labels and value is the label s precision .
def precision(self, labels, pred_scores):
        """
        Compute the precision
        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.
        thresholds: value list. This parameter effective only for 'binary'. The predict scores will be 1 if it larger than thresholds, if not,
                    if will be 0. If not only one threshold in it, it will return several results according to the thresholds. default None
        result_filter: value list. If result_filter is not None, it will filter the label results not in result_filter.
        Returns
        ----------
        dict
            The key is threshold and the value is another dic, which key is label in parameter labels, and value is the label's precision.
        """
        if self.eval_type == consts.BINARY:
            precision_operator = classification_metric.BiClassPrecision()
            metric_scores, score_threshold, cuts = precision_operator.compute(labels, pred_scores)
            return metric_scores, cuts, score_threshold
        elif self.eval_type == consts.MULTY:
            precision_operator = classification_metric.MultiClassPrecision()
            return precision_operator.compute(labels, pred_scores)
        else:
            logging.warning("error:can not find classification type:{}".format(self.eval_type))
def precision ( self , labels , pred_scores ) : if self . eval_type == consts . BINARY : precision_operator = classification_metric . BiClassPrecision ( ) metric_scores , score_threshold , cuts = precision_operator . compute ( labels , pred_scores ) return metric_scores , cuts , score_threshold elif self . eval_type == consts . MULTY : precision_operator = classification_metric . MultiClassPrecision ( ) return precision_operator . compute ( labels , pred_scores ) else : logging . warning ( "error:can not find classification type:{}" . format ( self . eval_type ) )