bigmlcom/sampling

Doesn't Handle Weight 0 Correctly

Closed this issue · 1 comments

To reproduce:

(frequencies 
 (take 100
       (sample [:heads :tails]
               :weigh {:heads 9 :tails 0}
               :seed 0
               :replace true
               )))

Returns {:tails 100}
Should return: {:heads 100}

From my project.clj:

  :dependencies [
                 [org.clojure/clojure "1.6.0"]
                 [bigml/sampling "2.1.0"]
                 ]

Thanks for the heads up. Fixed as of 1324389.