This is more a feature request than an issue (sorry if it is not the correct place to report this).
Description
I think it could be very useful to have a functionality that exports and imports efficiently a bounter object to and from a file.
Something like:
from bounter import CountMinSketch
cms = CountMinSketch(size_mb=xxx)
cms.update(['a', 'b', 'c', 'a'])
cms.export('file')
cms = CountMinSketch(file='file')
print(cms.counts['a'])
I believe this can be accomplished with this:
import pickle
from bounter import CountMinSketch
cms = CountMinSketch(size_mb=xxx)
cms.update(['a', 'b', 'c', 'a'])
with open('counter.pkl', 'wb') as f:
pickle.dump(cms, f)
with open('counter.pkl', 'rb') as f:
cms = pickle.load(f)
print(b.size())
print(b['a'])
But maybe there is a more efficient way to export the object.
Thank you in advance.
This is more a feature request than an issue (sorry if it is not the correct place to report this).
Description
I think it could be very useful to have a functionality that exports and imports efficiently a
bounterobject to and from a file.Something like:
I believe this can be accomplished with this:
But maybe there is a more efficient way to export the object.
Thank you in advance.