fe252155654dca245790f003792e648fbdaf8665,test/test_pytorchexperimentlogger.py,TestPytorchExperimentLogger,test_get_classification_metric,#TestPytorchExperimentLogger#,193

Before Change


            array = np.random.random_sample(100)
            labels = np.random.choice((0, 1), 100)

            vals, tags = self.experimentLogger.get_classification_metrics(array, labels,
                                                                          metric=("roc-auc", "pr-score"))

            self.assertTrue("roc-auc" in tags and "pr-score" in tags, "Did not get all classification metrics")

After Change



            ret_dict = get_classification_metrics(array, labels, metric=("roc-auc", "pr-score"))

            vals = list(ret_dict.values())

            self.assertTrue("roc-auc" in ret_dict and "pr-score" in ret_dict, "Did not get all classification metrics")
            self.assertTrue(vals[0] >= 0 and vals[0] <= 1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: MIC-DKFZ/trixi
Commit Name: fe252155654dca245790f003792e648fbdaf8665
Time: 2020-01-31
Author: d.zimmerer@dkfz-heidelberg.de
File Name: test/test_pytorchexperimentlogger.py
Class Name: TestPytorchExperimentLogger
Method Name: test_get_classification_metric


Project Name: dask/dask-image
Commit Name: c9fd2c425cb873508ba16221819574400ad2443e
Time: 2018-09-30
Author: jakirkham@gmail.com
File Name: dask_image/ndmeasure/__init__.py
Class Name:
Method Name: extrema


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 997875ab4734f08b153db53f4f3e546a7740a233
Time: 2020-11-04
Author: guillaumekln@users.noreply.github.com
File Name: opennmt/utils/misc.py
Class Name:
Method Name: get_variables_name_mapping


Project Name: ReactionMechanismGenerator/RMG-Py
Commit Name: 8d4d526906bf1b5113c63efcbd526ed2311cbe66
Time: 2019-08-29
Author: mjliu@mit.edu
File Name: utilities.py
Class Name:
Method Name: check_dependencies