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

Function test_minkowski

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

Source from the content-addressed store, hash-verified

131
132
133def test_minkowski(N=1):
134 np.random.seed(12345)
135 i = 0
136 while i < N:
137 N = np.random.randint(1, 100)
138 p = 1 + np.random.rand() * 10
139 x = np.random.rand(N)
140 y = np.random.rand(N)
141 mine = minkowski(x, y, p)
142 theirs = scipy.spatial.distance.minkowski(x, y, p)
143 np.testing.assert_almost_equal(mine, theirs)
144 print("PASSED")
145 i += 1
146
147
148def test_chebyshev(N=1):

Callers

nothing calls this directly

Calls 1

minkowskiFunction · 0.90

Tested by

no test coverage detected