Module: Seeder
- Defined in:
- lib/seeder.rb
Class Method Summary collapse
Class Method Details
.seed(all: false, cache_dir: nil) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/seeder.rb', line 7 def self.seed(all: false, cache_dir: nil) ps = [0.01, 0.001, 0.0001] cs = [1E4, 1E5] if all cs += [1E6, 1E7, 1E8] end cs.product(ps).each do |c, p| print "Generating filter for top #{c.to_i} with #{p} precision " b = Bloomed::PW.new(top: c, false_positive_probability: p, cache_dir: cache_dir) size = File.size(b.filename) puts "Done [#{size / KB} kb]" end end |