kmeans 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
- # Version:20121012
1
+ # Version:20121020
2
2
 
3
3
  source :rubygems
4
4
 
5
- gem 'rmagick'
5
+ # gem 'rmagick'
6
6
 
7
7
  group :test do
8
8
  gem 'rspec'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/doc/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.0.5 / 2012-10-30
2
+
3
+ * Eliminate the dependency for RMagick.
4
+
5
+
1
6
  === 0.0.4 / 2012-10-12
2
7
 
3
8
  * Fix hcluster important bug.
data/kmeans.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "kmeans"
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["id774"]
12
- s.date = "2012-10-12"
12
+ s.date = "2012-10-30"
13
13
  s.description = "K-means clustering"
14
14
  s.email = "idnanashi@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -54,18 +54,15 @@ Gem::Specification.new do |s|
54
54
  s.specification_version = 3
55
55
 
56
56
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
57
- s.add_runtime_dependency(%q<rmagick>, [">= 0"])
58
57
  s.add_development_dependency(%q<cucumber>, [">= 0"])
59
58
  s.add_development_dependency(%q<bundler>, [">= 0"])
60
59
  s.add_development_dependency(%q<jeweler>, [">= 0"])
61
60
  else
62
- s.add_dependency(%q<rmagick>, [">= 0"])
63
61
  s.add_dependency(%q<cucumber>, [">= 0"])
64
62
  s.add_dependency(%q<bundler>, [">= 0"])
65
63
  s.add_dependency(%q<jeweler>, [">= 0"])
66
64
  end
67
65
  else
68
- s.add_dependency(%q<rmagick>, [">= 0"])
69
66
  s.add_dependency(%q<cucumber>, [">= 0"])
70
67
  s.add_dependency(%q<bundler>, [">= 0"])
71
68
  s.add_dependency(%q<jeweler>, [">= 0"])
data/lib/kmeans.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  module Kmeans
5
- VERSION = "0.0.4"
5
+ VERSION = "0.0.5"
6
6
  require File.dirname(__FILE__) + "/kmeans/pair"
7
7
  require File.dirname(__FILE__) + "/kmeans/pearson"
8
8
  require File.dirname(__FILE__) + "/kmeans/cluster"
@@ -81,14 +81,14 @@ module Kmeans
81
81
  }
82
82
  1 - Pearson.calc(web_counts, centroid_counts)
83
83
  }
84
- correlations.rindex(correlations.min { |x, y| x.abs <=> y.abs })
84
+ correlations.rindex(correlations.min {|x, y| x.abs <=> y.abs })
85
85
  end
86
86
 
87
87
  def average_attached(centroid)
88
88
  average_word_counts = @cluster[centroid].map {|url|
89
89
  @centroids[centroid].keys.map {|word| @word_counts[url][word]}
90
90
  }.transpose.map {|all_counts|
91
- all_counts.inject(0) { |sum, count| sum + count }.quo(all_counts.size)
91
+ all_counts.inject(0) {|sum, count|sum + count}.quo(all_counts.size)
92
92
  }
93
93
  Hash[*@centroids[centroid].keys.zip(average_word_counts).flatten]
94
94
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Kmeans
4
4
  class Pearson
5
- def self.calc(v1,v2)
5
+ def self.calc(v1, v2)
6
6
  v1 = [v1] if v1.class != Array
7
7
  v2 = [v2] if v2.class != Array
8
8
 
@@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/../spec_helper'
5
5
  describe Kmeans do
6
6
  context 'のバージョンを参照した場合' do
7
7
  it "バージョンが正しく表示される" do
8
- expect = '0.0.4'
8
+ expect = '0.0.5'
9
9
  Kmeans.const_get(:VERSION).should be_true
10
10
  Kmeans.const_get(:VERSION).should == expect
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kmeans
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-12 00:00:00.000000000 Z
12
+ date: 2012-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rmagick
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
14
  - !ruby/object:Gem::Dependency
31
15
  name: cucumber
32
16
  requirement: !ruby/object:Gem::Requirement