Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How the sparse datasets are stored? #475

Open
zlwu92 opened this issue Oct 28, 2023 · 0 comments
Open

How the sparse datasets are stored? #475

zlwu92 opened this issue Oct 28, 2023 · 0 comments

Comments

@zlwu92
Copy link

zlwu92 commented Oct 28, 2023

Hi professor @maumueller ,

As you mentioned the Kosarak and MovieLens-10M are sparse dataset and they are packed like a scipy csr format,

So, when I use this distance function in https://github.com/erikbern/ann-benchmarks/blob/main/ann_benchmarks/distance.py#L104
to get train and test objects which are basically list object, right? np.ndarray.

Then I found that len of each row is not the same, so it still stored in compact style, right?

I guess that does each element in the rows represents the index of the non-zero element in the orignal sparse vector?

f = h5py.File(h5_file, 'r')
train, test = dataset_transform(f)
print(type(train))
print(len(train))
for i in train[0]:
      print(str(i), end=' ')
print()

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant