split_cat 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/split_cat/experiment.rb +9 -3
- data/lib/split_cat/version.rb +1 -1
- data/spec/dummy/log/test.log +6016 -0
- data/spec/models/split_cat/experiment_spec.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7421cdc1eda7110d22fe222b5b4ff9d7ca1ec037
|
4
|
+
data.tar.gz: 3ed2852232cef62c121ca812942f6e567bafe26b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1044cfae67cd1251fa899a6cfe7b102ee7adb08c760ed76d8b1775d0ab0ccfb5db353083a341b31a426e14f9ffbc758ac25a48e836e89eed052f3ae11e524644
|
7
|
+
data.tar.gz: cdbd49e89a8131acd3c6f103cafefd2d0bdbc910e8a963cde291564f94b116306d2555ac380d9a86ef7ced8cc63c64aaea00feed3d4e379b40fd78c0afbb723b
|
@@ -82,9 +82,15 @@ module SplitCat
|
|
82
82
|
|
83
83
|
def choose_hypothesis
|
84
84
|
total = 0
|
85
|
-
roll = rand( total_weight ) + 1
|
86
|
-
|
87
|
-
|
85
|
+
roll = Kernel.rand( total_weight ) + 1
|
86
|
+
hypothesis = nil
|
87
|
+
hypotheses.each do |h|
|
88
|
+
if roll <= ( total += h.weight )
|
89
|
+
hypothesis ||= h
|
90
|
+
end
|
91
|
+
end
|
92
|
+
hypothesis ||= hypotheses.first
|
93
|
+
return hypothesis
|
88
94
|
end
|
89
95
|
|
90
96
|
#############################################################################
|
data/lib/split_cat/version.rb
CHANGED