Ejemplo n.º 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})
Ejemplo n.º 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})
Ejemplo n.º 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})
Ejemplo n.º 4
0
 def testRemoveUnlikelyPredictionsEmpty(self):
   result = CLAModel._removeUnlikelyPredictions({}, 0.01, 3)
   self.assertDictEqual(result, {})