buncher 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/buncher.rb +2 -2
- 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.1"
|
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
|
@@ -67,7 +67,7 @@ module Buncher
|
|
67
67
|
# try all the sizes of clusters up to #elements. Ok, sure we could probably do something like 25% .. ok, I did
|
68
68
|
# that.
|
69
69
|
not_clustered = last_sK = last_aK =last_fK=nil
|
70
|
-
max_clusters=[1,elements.size
|
70
|
+
max_clusters=[1,elements.size].max
|
71
71
|
(1..max_clusters).each do |number_clusters|
|
72
72
|
initial_centers = choose_centers(elements, number_clusters) # C++ Native code
|
73
73
|
centers = initial_centers.map(&:dup)
|