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

Function generate_random_vector

tests/test-performance.py:48–54  ·  view source on GitHub ↗
(id: int, dimension: int)

Source from the content-addressed store, hash-verified

46
47
48def generate_random_vector(id: int, dimension: int) -> dict:
49 values = np.random.uniform(-1, 1, dimension).tolist()
50 return {
51 "id": f"vec_{id}",
52 "dense_values": values,
53 "document_id": f"doc_{id // 10}", # Group vectors into documents
54 }
55
56
57def generate_perturbation(

Callers 1

generate_batchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected