ab9ec50d0d8813d4e5921c35c7c39e7991a439db,test/classification/test_scorer.py,ScorerTest,test_scorer,#ScorerTest#,9

Before Change



class ScorerTest(unittest.TestCase):
    def test_scorer(self):
        golds = np.array([1, 0, 1, 0, 1])
        preds = np.array([1, 0, 1, 1, 0])
        probs = np.array([0.8, 0.6, 0.9, 0.7, 0.4])

        def sum(golds, preds, probs):
            return np.sum(preds)

After Change


            return np.sum(preds)

        scorer = Scorer(
            metrics=["accuracy", "f1"], custom_metric_funcs=dict(pred_sum=pred_sum)
        )

        results = scorer.score(*self._get_labels())
        results_expected = dict(accuracy=0.6, f1=2 / 3, pred_sum=3)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: snorkel-team/snorkel
Commit Name: ab9ec50d0d8813d4e5921c35c7c39e7991a439db
Time: 2019-08-13
Author: henry.ehrenberg@outlook.com
File Name: test/classification/test_scorer.py
Class Name: ScorerTest
Method Name: test_scorer


Project Name: DistrictDataLabs/yellowbrick
Commit Name: da729dab14194dba84e75571f08f927efbc19865
Time: 2019-08-22
Author: benjamin@bengfort.com
File Name: yellowbrick/classifier/confusion_matrix.py
Class Name: ConfusionMatrix
Method Name: score


Project Name: snorkel-team/snorkel
Commit Name: ab9ec50d0d8813d4e5921c35c7c39e7991a439db
Time: 2019-08-13
Author: henry.ehrenberg@outlook.com
File Name: test/classification/test_scorer.py
Class Name: ScorerTest
Method Name: test_scorer


Project Name: automl/HPOlib2
Commit Name: 706aa7deac1b851721adb4931e61ff344cf05d7f
Time: 2020-12-21
Author: muller-phil@gmx.net
File Name: tests/test_check_configuration.py
Class Name: TestCheckUnittest2
Method Name: test_config_decorator