Пример #1
0
 def test_t_student(self):
     """ Testing paired t-test. """
     rng = np.random.RandomState(42)
     a, b = rng.normal(loc=0, size=100), rng.normal(loc=0, size=100)
     result = paired_t_student(a, b, self.logger)
     self.assertGreater(result, 0.3)
     a, b = rng.normal(loc=-1, size=100), rng.normal(loc=1, size=100)
     result = paired_t_student(a, b, self.logger)
     self.assertLess(result, 0.001)
Пример #2
0
 def _paired_t_test(self, epm_rh, default, incumbent, num_permutations):
     def_cost, inc_cost = get_cost_dict_for_config(
         epm_rh, default), get_cost_dict_for_config(epm_rh, incumbent)
     data1, data2 = zip(*[(def_cost[i], inc_cost[i])
                          for i in def_cost.keys()])
     p = paired_t_student(data1, data2, logger=self.logger)
     self.logger.debug("p-value for def/inc-difference: %f (paired t-test)",
                       p)
     return p