(self, labels, pred_scores)
compute f1_score for binary classification result
compute f1_score for binary classification result
compute f1_score for binary classification result
def f1_score(self, labels, pred_scores):

        """
        compute f1_score for binary classification result
        """

        if self.eval_type == consts.BINARY:
            f1_scores, score_threshold, cuts = classification_metric.FScore().compute(labels, pred_scores)
            return list(f1_scores), list(cuts), list(score_threshold)
        else:
            logging.warning('error: f-score metric is for binary classification only')
def f1_score ( self , labels , pred_scores ) : if self . eval_type == consts . BINARY : f1_scores , score_threshold , cuts = classification_metric . FScore ( ) . compute ( labels , pred_scores ) return list ( f1_scores ) , list ( cuts ) , list ( score_threshold ) else : logging . warning ( 'error: f-score metric is for binary classification only' )