Esempio n. 1
0
 def test_can_set_params_as_array(self):
     kernel = RBFKernel(lengthscale=0.6, variance=0.75)
     kernel.set_params(np.array([1.2, 0.5]))
     assert_that(kernel.lengthscale, is_(equal_to(1.2)))
     assert_that(kernel.variance, is_(equal_to(0.5)))
Esempio n. 2
0
 def test_can_get_params_as_array(self):
     kernel = RBFKernel(lengthscale=0.6, variance=0.75)
     assert_equal(kernel.get_params(), np.array([0.6, 0.75]))
     assert_equal(kernel.params, np.array([0.6, 0.75]))