Empact-hierclust 0.2.2 → 0.3.0
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/Empact-hierclust.gemspec +2 -2
- data/History.txt +8 -0
- data/VERSION +1 -1
- data/lib/hierclust/clusterer.rb +2 -3
- metadata +4 -4
data/Empact-hierclust.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{Empact-hierclust}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brandt Kurowski", "Ben Woosley"]
|
12
|
-
s.date = %q{2010-11-
|
12
|
+
s.date = %q{2010-11-05}
|
13
13
|
s.description = %q{performs hierarchical clustering on points in Euclidian space}
|
14
14
|
s.email = %q{ben.woosley@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 0.3.0 2010-11-05
|
2
|
+
|
3
|
+
* 1 api change
|
4
|
+
* Clusterer.cluster takes a hash of options, rather than positional arguments for resolution & separation
|
5
|
+
* 2 minor enhancements
|
6
|
+
* Pass the :nils option to Cluster.cluster to provide a stand-in for nil values
|
7
|
+
* Allow Clusterer.cluster to apply resolution without separation
|
8
|
+
|
1
9
|
== 0.2.2 2010-11-01
|
2
10
|
|
3
11
|
* 1 minor enhancement
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/hierclust/clusterer.rb
CHANGED
@@ -51,9 +51,8 @@ module Hierclust
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def precluster(points)
|
54
|
-
unless @resolution
|
54
|
+
unless @resolution
|
55
55
|
# preclustering is only applicable given lower bound on resolution
|
56
|
-
# can't precluster w/ no min separation given
|
57
56
|
return points.dup
|
58
57
|
end
|
59
58
|
if @separation == 0
|
@@ -61,7 +60,7 @@ module Hierclust
|
|
61
60
|
return [Cluster.new(points)]
|
62
61
|
end
|
63
62
|
points.inject({}) do |grid_clusters, point|
|
64
|
-
grid_coordinates = point.coordinates.map {|coord| (coord / @resolution).floor }
|
63
|
+
grid_coordinates = point.coordinates.map {|coord| ((coord || @nils) / @resolution).floor }
|
65
64
|
grid_clusters[grid_coordinates] ||= Cluster.new([])
|
66
65
|
grid_clusters[grid_coordinates] << point
|
67
66
|
grid_clusters
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brandt Kurowski
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-11-
|
19
|
+
date: 2010-11-05 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|