Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

How do I save my bloom filter to a file? #23

Open
derrandz opened this issue Jun 17, 2016 · 2 comments
Open

How do I save my bloom filter to a file? #23

derrandz opened this issue Jun 17, 2016 · 2 comments

Comments

@derrandz
Copy link

Is there somehow I can store my full bloom filter to a file and load it again later on to check for new values?

@leopeng1995
Copy link

Did you try the Pickle module of Python? The object serialization can achieve your goal.

@joseph-fox
Copy link

joseph-fox commented Sep 25, 2016

@HOuaghad @leopeng1995 Pickle is likely to be the good choice for this purpose but there are two ready-to-use methods come along with the package.

sbf = ScalableBloomFilter(mode=ScalableBloomFilter.SMALL_SET_GROWTH)
with open('file_path' ,'w+') as fh:
      sbf.tofile(fh)

with open('/home/joseph/text.txt', 'r') as fh:
      sbf_from_file = ScalableBloomFilter.fromfile(fh)

Always use ScalableBloomFilter.

My branch has tweaked configuration for tightening ration and growth rate.

richard-rogers pushed a commit to whylabs/whylogs-bloom that referenced this issue Nov 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants