示例#1
0
 def test_find_threshold_6(self):
     probs = np.array([0.9, 0.8, 0.6, 0.6, 0.6, 0.6, 0.3])
     target = 0.0
     thresh, q = DPSniper._find_threshold(probs, target)
     self.assertEqual(0.9, thresh)
     self.assertEqual(0.0, q)
示例#2
0
 def test_find_threshold_1(self):
     probs = np.array([0.9, 0.8, 0.6, 0.6, 0.6, 0.6, 0.3])
     target = 3.2
     thresh, q = DPSniper._find_threshold(probs, target)
     self.assertEqual(0.6, thresh)
     self.assertAlmostEqual(0.3, q)