MCPcopy
hub / github.com/ddbourgin/numpy-ml / test_linear_kernel

Function test_linear_kernel

numpy_ml/tests/test_utils.py:35–51  ·  view source on GitHub ↗
(N=1)

Source from the content-addressed store, hash-verified

33
34
35def test_linear_kernel(N=1):
36 np.random.seed(12345)
37 i = 0
38 while i < N:
39 N = np.random.randint(1, 100)
40 M = np.random.randint(1, 100)
41 C = np.random.randint(1, 1000)
42
43 X = np.random.rand(N, C)
44 Y = np.random.rand(M, C)
45
46 mine = LinearKernel()(X, Y)
47 gold = sk_linear(X, Y)
48
49 np.testing.assert_almost_equal(mine, gold)
50 print("PASSED")
51 i += 1
52
53
54def test_polynomial_kernel(N=1):

Callers

nothing calls this directly

Calls 1

LinearKernelClass · 0.90

Tested by

no test coverage detected