Example #1
0
 def test_default_kernel_computation_on_2d_points(self):
     x1 = a([1.0, 2.0])
     x2 = a([3.0, 4.0])
     k = default_kernel(x1, x2)
     self.assertAlmostEqual(k, .018315639)
Example #2
0
 def test_default_kernel_computation_yields_0_when_very_different(self):
     x1 = a([1.0])
     x2 = a([float(sys.maxint)])
     k = default_kernel(x1, x2)
     self.assertAlmostEqual(k, 0.0)
Example #3
0
 def test_default_kernel_computation_with_specific_computations(self):
     x1 = a([1.0])
     x2 = a([3.0])
     k = default_kernel(x1, x2)
     self.assertAlmostEqual(k, .135335283)
Example #4
0
 def test_default_kernel_computation_yields_1_when_same(self):
     x1 = a([1.0])
     x2 = a([1.0])
     k = default_kernel(x1, x2)
     self.assertAlmostEqual(k, 1.0)