9dec020281ee9521e7f1ffd696bcbb102c399703,allennlp/training/metrics/f1_measure.py,F1Measure,get_metric,#F1Measure#Any#,74

Before Change


        f1-measure : float
        
        precision = float(self._true_positives) / float(self._true_positives + self._false_positives + 1e-13)
        recall = float(self._true_positives) / float(self._true_positives + self._false_negatives + 1e-13)
        f1_measure = 2. * ((precision * recall) / (precision + recall + 1e-13))
        if reset:
            self.reset()
        return precision, recall, f1_measure

After Change


        recall : float
        f1-measure : float
        
        metric = super().get_metric(reset=reset)
        // Because we just care about the class `positive_label`
        // there is just one item in `precision`, `recall`, `fscore`
        precision = metric["precision"][0]
        recall = metric["recall"][0]
        fscore = metric["fscore"][0]
        return precision, recall, fscore

    @property
    def _true_positives(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: allenai/allennlp
Commit Name: 9dec020281ee9521e7f1ffd696bcbb102c399703
Time: 2019-04-22
Author: wrran@outlook.com
File Name: allennlp/training/metrics/f1_measure.py
Class Name: F1Measure
Method Name: get_metric


Project Name: deepinsight/insightface
Commit Name: eb6aea6e708e0fd87ca6e168a88c60a6fad570c9
Time: 2018-07-09
Author: guojia@gmail.com
File Name: SSH/test.py
Class Name:
Method Name:


Project Name: deepinsight/insightface
Commit Name: 74cdf6d00ff239ea6559812fa157bd138e2578cb
Time: 2018-07-09
Author: guojia@gmail.com
File Name: SSH/test.py
Class Name:
Method Name: