buncher 1.0.13 → 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/buncher.rb +7 -3
- metadata +1 -1
data/lib/buncher.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'buncher/buncher'
|
2
2
|
module Buncher
|
3
|
-
VERSION = "1.0.
|
3
|
+
VERSION = "1.0.14"
|
4
4
|
# your cluster needs to look like this. Make a bunch of them and pass them in. It's ok to pass in empty elements to start.
|
5
5
|
class Cluster
|
6
6
|
attr_accessor :elements
|
@@ -86,8 +86,12 @@ module Buncher
|
|
86
86
|
end
|
87
87
|
solutions.select! {|min_fK| min_fK <= 0.85}
|
88
88
|
min_fKs =solutions.keys.sort[0...plausable] || [1.0]
|
89
|
-
if options[:plausable]
|
90
|
-
|
89
|
+
if options[:plausable]
|
90
|
+
if min_fKs.empty?
|
91
|
+
solutions.select {|key| min_fKs.include?(key)}.sort
|
92
|
+
else
|
93
|
+
[1.0, elements.map {|ele| Cluster.new(ele,[ele])}] # ie, not clustered at all
|
94
|
+
end
|
91
95
|
elsif !min_fKs.empty?
|
92
96
|
solutions[min_fKs.first]
|
93
97
|
else
|