MCPcopy Create free account
hub / github.com/cosdata/cosdata / magnitude

Function magnitude

tests/rps-test.py:206–207  ·  view source on GitHub ↗
(vec)

Source from the content-addressed store, hash-verified

204
205
206def magnitude(vec):
207 return np.sqrt(sum(v**2 for v in vec))
208
209
210def cosine_similarity(vec1, vec2):

Callers 1

cosine_similarityFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected