k_means_pp 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Rakefile +2 -0
- data/k_means_pp.gemspec +3 -3
- data/lib/k_means_pp.rb +1 -1
- data/lib/k_means_pp/cluster.rb +2 -2
- data/lib/k_means_pp/point.rb +3 -3
- data/lib/k_means_pp/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de62fbdd258e4e910cafe5b1c3eabbc006fc7bdf
|
4
|
+
data.tar.gz: 27edf10754d005cfd6a75d27edaf956429d5460c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0832f023aa270b89f37f407265cab8c6e3d98d00778035cf7a25f56355397d2f94c29da2f1bad6594455887718ff1908008e37828caa29015c3afc7d11aa26af
|
7
|
+
data.tar.gz: 1e3173dccef69f459b9791713f3ad1a9d73d6a57842b5672b5fe29fc3c33b38e957b0cec1d56cd60f914d4d0371a4dd9de9249554890c38a2997c8dbe39781ef
|
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
data/k_means_pp.gemspec
CHANGED
@@ -23,14 +23,14 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
25
|
# System
|
26
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.10'
|
27
27
|
|
28
28
|
# Test
|
29
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
29
|
+
spec.add_development_dependency 'rspec', '~> 3.3'
|
30
30
|
spec.add_development_dependency 'simplecov', '~> 0.10'
|
31
31
|
|
32
32
|
# Code style, debugging, docs
|
33
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
33
|
+
spec.add_development_dependency 'rubocop', '~> 0.32'
|
34
34
|
spec.add_development_dependency 'pry', '~> 0.10'
|
35
35
|
spec.add_development_dependency 'yard', '~> 0.8'
|
36
36
|
spec.add_development_dependency 'rake', '~> 10.4'
|
data/lib/k_means_pp.rb
CHANGED
data/lib/k_means_pp/cluster.rb
CHANGED
@@ -23,8 +23,8 @@ class KMeansPP
|
|
23
23
|
# A string representation of the cluster.
|
24
24
|
def to_s
|
25
25
|
o = ''
|
26
|
-
o << "Cluster #{
|
27
|
-
points.each { |p| o << " #{
|
26
|
+
o << "Cluster #{centroid}: [\n"
|
27
|
+
points.each { |p| o << " #{p},\n" }
|
28
28
|
o << "]\n"
|
29
29
|
o
|
30
30
|
end
|
data/lib/k_means_pp/point.rb
CHANGED
@@ -25,7 +25,7 @@ class KMeansPP
|
|
25
25
|
|
26
26
|
# A string representation of the point.
|
27
27
|
def to_s
|
28
|
-
"(#{
|
28
|
+
"(#{x}, #{y})"
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -80,8 +80,8 @@ class KMeansPP
|
|
80
80
|
# @param point [Point]
|
81
81
|
def add(point)
|
82
82
|
self.counter += 1
|
83
|
-
self.x
|
84
|
-
self.y
|
83
|
+
self.x += point.x
|
84
|
+
self.y += point.y
|
85
85
|
end
|
86
86
|
|
87
87
|
# At this point X and Y properties will contain sums of all the point
|
data/lib/k_means_pp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: k_means_pp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oldrich Vetesnik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.10'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.10'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '3.
|
33
|
+
version: '3.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '3.
|
40
|
+
version: '3.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: simplecov
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
61
|
+
version: '0.32'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0.
|
68
|
+
version: '0.32'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
160
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.4.
|
161
|
+
rubygems_version: 2.4.8
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: K-means++ Algorithm Implementation.
|