def test_rho_one_item(self): self.__init_test(test.SMALL_DEL_FILE) smooth_func = 'Bayes' lambda_ = 0.1 _, vc = self.build_value_calculator(self.annots, smooth_func, lambda_) rho = vc.calc_rho(0, np.array([0.0]), np.array([0])) self.assertEqual(rho, 1 - dktau([0], [0], k=1, p=1))
def test_rho_inverse(self): self.__init_test(test.SMALL_DEL_FILE) smooth_func = 'Bayes' lambda_ = 0.1 _, vc = self.build_value_calculator(self.annots, smooth_func, lambda_) rho = vc.calc_rho(0, np.array([10, 0, 2.0]), np.array([0, 1, 2])) self.assertEqual(rho, 1 - dktau([0, 2, 1], [0, 2], k=2, p=1))