MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / test_euclidean

Function test_euclidean

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

Source from the content-addressed store, hash-verified

103
104
105def test_euclidean(N=1):
106 np.random.seed(12345)
107 i = 0
108 while i < N:
109 N = np.random.randint(1, 100)
110 x = np.random.rand(N)
111 y = np.random.rand(N)
112 mine = euclidean(x, y)
113 theirs = scipy.spatial.distance.euclidean(x, y)
114 np.testing.assert_almost_equal(mine, theirs)
115 print("PASSED")
116 i += 1
117
118
119def test_hamming(N=1):

Callers

nothing calls this directly

Calls 1

euclideanFunction · 0.90

Tested by

no test coverage detected