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