示例#1
0
 def testRemoveUnlikelyPredictionsMaxPredictions(self):
   result = CLAModel._removeUnlikelyPredictions({1: 0.1, 2: 0.2, 3: 0.3},
                                                0.01, 3)
   self.assertDictEqual(result, {1: 0.1, 2: 0.2, 3: 0.3})
   result = CLAModel._removeUnlikelyPredictions(
       {1: 0.1, 2: 0.2, 3: 0.3, 4: 0.4}, 0.01, 3)
   self.assertDictEqual(result, {2: 0.2, 3: 0.3, 4: 0.4})
示例#2
0
 def testRemoveUnlikelyPredictionsLikelihoodThresholds(self):
   result = CLAModel._removeUnlikelyPredictions({1: 0.1, 2: 0.001}, 0.01, 3)
   self.assertDictEqual(result, {1: 0.1})
   result = CLAModel._removeUnlikelyPredictions({1: 0.001, 2: 0.002}, 0.01, 3)
   self.assertDictEqual(result, {2: 0.002})
   result = CLAModel._removeUnlikelyPredictions({1: 0.002, 2: 0.001}, 0.01, 3)
   self.assertDictEqual(result, {1: 0.002})
示例#3
0
 def testRemoveUnlikelyPredictionsSingleValues(self):
   result = CLAModel._removeUnlikelyPredictions({1: 0.1}, 0.01, 3)
   self.assertDictEqual(result, {1: 0.1})
   result = CLAModel._removeUnlikelyPredictions({1: 0.001}, 0.01, 3)
   self.assertDictEqual(result, {1: 0.001})
示例#4
0
 def testRemoveUnlikelyPredictionsEmpty(self):
   result = CLAModel._removeUnlikelyPredictions({}, 0.01, 3)
   self.assertDictEqual(result, {})