示例#1
0
 def test_compute_taxon_accuracy_all_match(self):
     res = compute_taxon_accuracy(pd.Series({
         'a;b': 1,
         'b;c': 1,
         'c;d': 1
     }), pd.Series({
         'a;b': 1,
         'b;c': 1,
         'c;d': 1
     }))
     self.assertEqual(res, (1., 1.))
示例#2
0
 def test_compute_taxon_accuracy_no_matches(self):
     res = compute_taxon_accuracy(
         pd.Series({
             'a': 1,
             'b': 1,
             'c': 1
         }), pd.Series({
             'a;b': 1,
             'b;c': 1,
             'c;e': 1,
             'd;e': 1
         }))
     self.assertEqual(res, (0., 0.))
示例#3
0
 def test_compute_taxon_accuracy(self):
     res = compute_taxon_accuracy(
         pd.Series({
             'a;b': 1,
             'b;c': 1,
             'c;d': 1
         }), pd.Series({
             'a;b': 1,
             'b;c': 1,
             'c;e': 1,
             'd;e': 1
         }))
     self.assertEqual(res, (0.6666666666666666, 0.5))