def test_normalizing_constant(self): """check that normalizing_constant returns the correct value for a given bandwidth.""" train_data = np.array([[1,0],[2,0],[3,0]]) bandwidth = 0.25 kde = Kde(train_data, bandwidth) constant = kde.normalizing_constant() expected_constant = 2.54647908 self.assertAlmostEqual(expected_constant, constant, ACCURACY)
def test_normalizing_constant(self): """check that normalizing_constant returns the correct value for a given bandwidth.""" train_data = np.array([[1, 0], [2, 0], [3, 0]]) bandwidth = 0.25 kde = Kde(train_data, bandwidth) constant = kde.normalizing_constant() expected_constant = 2.54647908 self.assertAlmostEqual(expected_constant, constant, ACCURACY)