--- task_categories: - feature-extraction tags: - vector-search - retrieval size_categories: - 100M YYYY-MM-dd HH:mm:ss 140202072008 base.1B.i8bin > YYYY-MM-dd HH:mm:ss 11726408 groundtruth.30K.f32bin > YYYY-MM-dd HH:mm:ss 11726408 groundtruth.30K.i32bin > YYYY-MM-dd HH:mm:ss 2931608 query.30K.i8bin ``` To download the dataset into a local directory, use the following command: ```bash mkdir -p datasets/spacev-1b/ aws s3 cp s3://bigger-ann/spacev-1b/ datasets/spacev-1b/ --recursive ``` For convenience, a smaller 100M subset is also available on HuggingFace via LFS: ```bash mkdir -p datasets/spacev-100m/ && \ wget -nc https://huggingface.co/datasets/unum-cloud/ann-spacev-100m/resolve/main/ids.100m.i32bin -P datasets/spacev-100m/ && wget -nc https://huggingface.co/datasets/unum-cloud/ann-spacev-100m/resolve/main/base.100m.i8bin -P datasets/spacev-100m/ && wget -nc https://huggingface.co/datasets/unum-cloud/ann-spacev-100m/resolve/main/query.30K.i8bin -P datasets/spacev-100m/ && wget -nc https://huggingface.co/datasets/unum-cloud/ann-spacev-100m/resolve/main/groundtruth.30K.i32bin -P datasets/spacev-100m/ && wget -nc https://huggingface.co/datasets/unum-cloud/ann-spacev-100m/resolve/main/groundtruth.30K.f32bin -P datasets/spacev-100m/ ``` ## Usage The dataset can be loaded with the following Python code, "viewing" the data to avoid pulling everything into memory: ```python from usearch.io import load_matrix base_view = load_matrix("base.1B.i8bin", dtype=np.int8, view=True) queries = load_matrix("query.30K.i8bin", dtype=np.int8) matches = load_matrix("groundtruth.30K.i32bin", dtype=np.int32) distances = load_matrix("groundtruth.30K.f32bin", dtype=np.float32) ``` To construct an index and check the recall against ground truth: ```python from usearch.index import Index, BatchMatches index = Index(ndim=100, metric="l2sq", dtype="i8") index.add(None, base_view) # Use incremental keys from 0 to len(base_view) matches: BatchMatches = index.search(queries) ``` On a modern high-core-count system, constructing the index can be performed at 150'000 vectors per second and will take around 3 hours. To switch to a smaller dataset, replace the file paths with the corresponding 100M versions: ```python from usearch.io import load_matrix base = load_matrix("base.100M.i8bin", dtype=np.int8) ids = load_matrix("ids.100M.i32bin", dtype=np.int32) queries = load_matrix("query.30K.i8bin", dtype=np.int8) matches = load_matrix("groundtruth.30K.i32bin", dtype=np.int32) distances = load_matrix("groundtruth.30K.f32bin", dtype=np.float32) from usearch.index import Index, BatchMatches index = Index(ndim=100, metric="l2sq", dtype="i8") index.add(ids, base) matches: BatchMatches = index.search(queries) ```