ml 0.1.0 → 0.1.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/VERSION +1 -1
- data/lib/data/generator.rb +76 -77
- data/lib/data/parser.rb +24 -20
- data/lib/data/plotter.rb +66 -63
- data/lib/method/perceptron.rb +50 -49
- data/lib/ml.rb +8 -0
- data/ml.gemspec +4 -3
- data/spec/data_spec.rb +24 -0
- data/spec/learner_spec.rb +35 -0
- data/spec/spec_helper.rb +1 -1
- metadata +19 -18
- data/spec/learning_spec.rb +0 -7
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/data/generator.rb
CHANGED
@@ -1,98 +1,97 @@
|
|
1
1
|
require 'matrix'
|
2
2
|
|
3
3
|
module ML
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
# Initialize a generator
|
16
|
-
#
|
17
|
-
# @param [Integer] x range
|
18
|
-
# @param [Integer] y range
|
19
|
-
def initialize x_range = 100, y_range = 100
|
20
|
-
@x_range = x_range
|
21
|
-
@y_range = y_range
|
22
|
-
end
|
4
|
+
module Data
|
5
|
+
# Generating sample points on 2D plane
|
6
|
+
class Generator2D
|
7
|
+
# Generate point from line
|
8
|
+
#
|
9
|
+
# @param [Array] coef [a,b,c] for ax+by+c=0
|
10
|
+
# @param [Number] x x value
|
11
|
+
# @return [Array] point
|
12
|
+
def self.point_from_line coef, x
|
13
|
+
[x, (-coef[2]-(coef[0] * x))/coef[1]]
|
14
|
+
end
|
23
15
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
[1, -1].each do |grp|
|
33
|
-
result << []
|
16
|
+
# Initialize a generator
|
17
|
+
#
|
18
|
+
# @param [Integer] x_range x range
|
19
|
+
# @param [Integer] y_range y range
|
20
|
+
def initialize x_range = 100, y_range = 100
|
21
|
+
@x_range = x_range
|
22
|
+
@y_range = y_range
|
23
|
+
end
|
34
24
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
25
|
+
# Generate two groups of points on 2d plain
|
26
|
+
#
|
27
|
+
# @param [Integer] points the number of points of each set
|
28
|
+
# @param [Array] coef [a,b,c] for ax+by+c=0
|
29
|
+
# @return [Hash] key: points, value: supervised value
|
30
|
+
def points_2d points, coef = [-1.0, 1.0, 0.0]
|
31
|
+
result = {}
|
32
|
+
# for each group
|
33
|
+
[1, -1].each do |grp|
|
34
|
+
points.times do
|
35
|
+
while true
|
36
|
+
point = generate_point
|
37
|
+
prod = Matrix.column_vector(point).transpose * Matrix.column_vector(coef)
|
38
|
+
if (prod[0,0] <=> 0) == grp
|
39
|
+
result[point] = grp
|
40
|
+
break
|
41
|
+
end
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
45
|
+
result
|
45
46
|
end
|
46
|
-
result
|
47
|
-
end
|
48
47
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
# General generator for n-dimentional space
|
56
|
-
class Generator
|
57
|
-
# Initial generator
|
58
|
-
#
|
59
|
-
# @param [Integer] dimension
|
60
|
-
def initialize dim
|
61
|
-
@dim = dim
|
48
|
+
private
|
49
|
+
def generate_point
|
50
|
+
[@x_range * rand, @y_range * rand, 1.0]
|
51
|
+
end
|
62
52
|
end
|
63
53
|
|
64
|
-
#
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
[1, -1].each do |grp|
|
73
|
-
result << []
|
54
|
+
# General generator for n-dimentional space
|
55
|
+
class Generator
|
56
|
+
# Initial generator
|
57
|
+
#
|
58
|
+
# @param [Integer] dim dimension
|
59
|
+
def initialize dim
|
60
|
+
@dim = dim
|
61
|
+
end
|
74
62
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
63
|
+
# Generate two groups of points
|
64
|
+
#
|
65
|
+
# @param [Integer] points the number of points of each set
|
66
|
+
# @param [Array] coef array of the size of dimension to specify the hyper plane
|
67
|
+
# @return [Hash] key: points, value: supervised value
|
68
|
+
def points points, coef
|
69
|
+
result = {}
|
70
|
+
# for each group
|
71
|
+
[1, -1].each do |grp|
|
72
|
+
points.times do
|
73
|
+
while true
|
74
|
+
point = Generator.generate_vector(@dim, 100)
|
75
|
+
prod = Matrix.column_vector(point).transpose * Matrix.column_vector(coef)
|
76
|
+
if (prod[0,0] <=> 0) == grp
|
77
|
+
result[point] = grp
|
78
|
+
break
|
79
|
+
end
|
82
80
|
end
|
83
81
|
end
|
84
82
|
end
|
83
|
+
result
|
85
84
|
end
|
86
|
-
result
|
87
|
-
end
|
88
85
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
86
|
+
# Generating a random vector
|
87
|
+
#
|
88
|
+
# @param [Integer] dim the dimension of the vector
|
89
|
+
# @param [Integer] scale the scale of each component
|
90
|
+
# @return [Array] random vector
|
91
|
+
def self.generate_vector dim, scale = 1
|
92
|
+
result = Array.new(dim) { (rand - 0.5) * scale }
|
93
|
+
result << 1.0
|
94
|
+
end
|
96
95
|
end
|
97
96
|
end
|
98
97
|
end
|
data/lib/data/parser.rb
CHANGED
@@ -1,27 +1,31 @@
|
|
1
1
|
module ML
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
module Data
|
3
|
+
# Parser for traing/testing data
|
4
|
+
class Parser
|
5
|
+
# Parse the vector file with supervised result
|
6
|
+
#
|
7
|
+
# @param [String] filename filename of the input data
|
8
|
+
# @return [Hash] map from data to supervised result
|
9
|
+
def parse_supervised filename
|
10
|
+
result = {}
|
11
|
+
lines = IO.readlines(filename)
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
lines.each do |line|
|
14
|
+
splitted = line.split.map(&:to_f)
|
15
|
+
result[splitted[1..-1] + [1.0]] = splitted[0]
|
16
|
+
end
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
+
result
|
19
|
+
end
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
# Parse the vector file
|
22
|
+
#
|
23
|
+
# @param [String] filename filename of the input data
|
24
|
+
# @return [Array] array of vectors
|
25
|
+
def parse_unsupervised filename
|
26
|
+
lines = IO.readlines(filename)
|
27
|
+
lines.map {|line| line.split.map(&:to_f) }
|
28
|
+
end
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
data/lib/data/plotter.rb
CHANGED
@@ -1,77 +1,80 @@
|
|
1
1
|
require 'rubyvis'
|
2
2
|
|
3
3
|
module ML
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
4
|
+
module Data
|
5
|
+
# Plotting the data to svg
|
6
|
+
class Plotter
|
7
|
+
# Initializer of plotter
|
8
|
+
#
|
9
|
+
# @param [Integer] x_range x value range
|
10
|
+
# @param [Integer] y_range y value range
|
11
|
+
# @param [Integer] x_size x plot size
|
12
|
+
# @param [Integer] y_size y plot size
|
13
|
+
def initialize x_range = 100, y_range = 100, x_size = 100, y_size = 100
|
14
|
+
@x_range = x_range
|
15
|
+
@y_range = y_range
|
16
|
+
@x_size = x_size
|
17
|
+
@y_size = y_size
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
@x = pv.Scale.linear(0, @x_range).range(0, @x_size)
|
20
|
+
@y = pv.Scale.linear(0, @y_range).range(0, @y_size)
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
22
|
+
@vis = pv.Panel.new.width(@x_size).height(@y_size)
|
23
|
+
.bottom(20).left(20).right(10).top(5)
|
24
|
+
|
25
|
+
@vis.add(pv.Rule).data(@y.ticks()).bottom(@y)
|
26
|
+
.stroke_style(lambda {|d| d!=0 ? "#eee" : "#000"})
|
27
|
+
.anchor("left").add(pv.Label)
|
28
|
+
.visible(lambda {|d| d > 0 and d < x_range})
|
29
|
+
.text(@y.tick_format)
|
30
|
+
|
31
|
+
@vis.add(pv.Rule).data(@x.ticks()).left(@x)
|
32
|
+
.stroke_style(lambda {|d| d!=0 ? "#eee" : "#000"})
|
33
|
+
.anchor("bottom").add(pv.Label)
|
34
|
+
.visible(lambda {|d| d > 0 and d < y_range})
|
35
|
+
.text(@x.tick_format)
|
35
36
|
|
36
|
-
|
37
|
-
|
37
|
+
yield(self) if block_given?
|
38
|
+
end
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
40
|
+
# Plotting points with shape and color
|
41
|
+
#
|
42
|
+
# @param [Array] points points to plot
|
43
|
+
# @param [String] shape shape of the points
|
44
|
+
# @param [String] color color of the points
|
45
|
+
def dot points, shape = "circle", color = "#000"
|
46
|
+
# FIXME: dirty hack for instance_exec
|
47
|
+
x = @x
|
48
|
+
y = @y
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
@vis.add(pv.Dot).data(points)
|
51
|
+
.left(lambda {|d| x.scale(d[0])})
|
52
|
+
.bottom(lambda {|d| y.scale(d[1])})
|
53
|
+
.shape(shape)
|
54
|
+
.stroke_style(color)
|
55
|
+
end
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
# Plotting line with color
|
58
|
+
#
|
59
|
+
# @param [Array] points 2 points which represents line
|
60
|
+
# @param [String] color color of the line
|
61
|
+
def line points, color = "#000"
|
62
|
+
x = @x
|
63
|
+
y = @y
|
62
64
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
65
|
+
@vis.add(pv.Line).data(points)
|
66
|
+
.left(lambda {|d| x.scale(d[0])})
|
67
|
+
.bottom(lambda {|d| y.scale(d[1])})
|
68
|
+
.stroke_style(color)
|
69
|
+
end
|
68
70
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
# Convert to svg
|
72
|
+
#
|
73
|
+
# @return [String] svg plot
|
74
|
+
def to_svg
|
75
|
+
@vis.render
|
76
|
+
@vis.to_svg
|
77
|
+
end
|
75
78
|
end
|
76
79
|
end
|
77
80
|
end
|
data/lib/method/perceptron.rb
CHANGED
@@ -1,66 +1,67 @@
|
|
1
1
|
require 'matrix'
|
2
2
|
|
3
3
|
module ML
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
module Learner
|
5
|
+
# Implementation of Perceptron Learning Algorithm
|
6
|
+
class PerceptronLearner
|
7
|
+
# Initialize a perceptron learner
|
8
|
+
#
|
9
|
+
# @param [Integer] dim the number of dimension
|
10
|
+
def initialize dim
|
11
|
+
@dim = dim
|
12
|
+
@w = Matrix.column_vector(Array.new(dim + 1, 0))
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
misclassified = false
|
15
|
+
# Train with supervised data
|
16
|
+
#
|
17
|
+
# @param [Hash] data supervised input data (mapping from array to integer)
|
18
|
+
def train! data
|
19
|
+
@update = 0
|
20
|
+
while true
|
21
|
+
misclassified = false
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
for dat, result in data
|
24
|
+
aug_data = Matrix.column_vector(dat)
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
if classify(aug_data) != result
|
27
|
+
misclassified = true
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
@w = @w + result * aug_data
|
30
|
+
@update += 1
|
31
|
+
break
|
32
|
+
end
|
32
33
|
end
|
33
|
-
end
|
34
34
|
|
35
|
-
|
35
|
+
break unless misclassified
|
36
|
+
end
|
36
37
|
end
|
37
|
-
end
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
39
|
+
# The final coefficient of the line
|
40
|
+
#
|
41
|
+
# @return [Array] [a,b,c] for ax+by+c=0
|
42
|
+
def line
|
43
|
+
@w.column(0).to_a
|
44
|
+
end
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# The number for updates
|
47
|
+
#
|
48
|
+
# @return [Integer] update count
|
49
|
+
def update_count
|
50
|
+
@update
|
51
|
+
end
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
53
|
+
# Predict certain data
|
54
|
+
#
|
55
|
+
# @param [Array] data data in question
|
56
|
+
# @return [Integer] prediction
|
57
|
+
def predict data
|
58
|
+
classify Matrix.column_vector(data + [1.0])
|
59
|
+
end
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
private
|
62
|
+
def classify data
|
63
|
+
(@w.transpose * data)[0,0] <=> 0
|
64
|
+
end
|
64
65
|
end
|
65
66
|
end
|
66
67
|
end
|
data/lib/ml.rb
CHANGED
@@ -7,7 +7,15 @@ require 'data/parser'
|
|
7
7
|
|
8
8
|
require 'method/perceptron'
|
9
9
|
|
10
|
+
# Top namespace for machine learning algorithms
|
10
11
|
module ML
|
12
|
+
# Data processing module
|
13
|
+
module Data
|
14
|
+
end
|
15
|
+
|
16
|
+
# Learning algorithms
|
17
|
+
module Learner
|
18
|
+
end
|
11
19
|
end
|
12
20
|
|
13
21
|
MachingLearning = ML
|
data/ml.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "ml"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andrew Liu"]
|
12
|
-
s.date = "2011-10-
|
12
|
+
s.date = "2011-10-04"
|
13
13
|
s.description = "Machine learning library in Ruby"
|
14
14
|
s.email = "andrewliu33@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -29,7 +29,8 @@ Gem::Specification.new do |s|
|
|
29
29
|
"lib/method/perceptron.rb",
|
30
30
|
"lib/ml.rb",
|
31
31
|
"ml.gemspec",
|
32
|
-
"spec/
|
32
|
+
"spec/data_spec.rb",
|
33
|
+
"spec/learner_spec.rb",
|
33
34
|
"spec/spec_helper.rb"
|
34
35
|
]
|
35
36
|
s.homepage = "http://github.com/eggegg/ml"
|
data/spec/data_spec.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Data" do
|
4
|
+
it "should plot a single plot" do
|
5
|
+
graph = ML::Data::Plotter.new(100, 100, 100, 100) do |p|
|
6
|
+
p.dot [[10,10], [20,20]]
|
7
|
+
p.line [[0,50], [100,50]]
|
8
|
+
end
|
9
|
+
|
10
|
+
graph.to_svg.kind_of?(String).should == true
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should generate points" do
|
14
|
+
hyperplane = ML::Data::Generator.generate_vector(4)
|
15
|
+
hyperplane.size.should == 5
|
16
|
+
|
17
|
+
generator = ML::Data::Generator.new(4)
|
18
|
+
points = generator.points(10, hyperplane)
|
19
|
+
|
20
|
+
points.kind_of?(Hash).should == true
|
21
|
+
points.first.kind_of?(Array).should == true
|
22
|
+
points.first.first.size.should == 5
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Learner" do
|
4
|
+
describe "Perceptron Learner" do
|
5
|
+
it "should run perceptron learning in 2d" do
|
6
|
+
learner = ML::Learner::PerceptronLearner.new(2)
|
7
|
+
|
8
|
+
generator = ML::Data::Generator2D.new
|
9
|
+
data = generator.points_2d(10)
|
10
|
+
|
11
|
+
learner.train! data
|
12
|
+
|
13
|
+
line = learner.line
|
14
|
+
line.should.kind_of?(Array).should == true
|
15
|
+
line.size.should == 3
|
16
|
+
|
17
|
+
learner.update_count.should > 0
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should run perceptron learning in hyperspace" do
|
21
|
+
learner = ML::Learner::PerceptronLearner.new(4)
|
22
|
+
|
23
|
+
generator = ML::Data::Generator.new(4)
|
24
|
+
data = generator.points(10, ML::Data::Generator.generate_vector(4))
|
25
|
+
|
26
|
+
learner.train! data
|
27
|
+
|
28
|
+
line = learner.line
|
29
|
+
line.should.kind_of?(Array).should == true
|
30
|
+
line.size.should == 5
|
31
|
+
|
32
|
+
learner.update_count.should > 0
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubyvis
|
16
|
-
requirement: &
|
16
|
+
requirement: &2158153020 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2158153020
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nokogiri
|
27
|
-
requirement: &
|
27
|
+
requirement: &2158152400 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2158152400
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bacon
|
38
|
-
requirement: &
|
38
|
+
requirement: &2158151760 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2158151760
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: yard
|
49
|
-
requirement: &
|
49
|
+
requirement: &2158151260 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.6.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2158151260
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: bundler
|
60
|
-
requirement: &
|
60
|
+
requirement: &2158150660 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.0.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2158150660
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jeweler
|
71
|
-
requirement: &
|
71
|
+
requirement: &2158150040 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.6.4
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2158150040
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rcov
|
82
|
-
requirement: &
|
82
|
+
requirement: &2158149480 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *2158149480
|
91
91
|
description: Machine learning library in Ruby
|
92
92
|
email: andrewliu33@gmail.com
|
93
93
|
executables: []
|
@@ -108,7 +108,8 @@ files:
|
|
108
108
|
- lib/method/perceptron.rb
|
109
109
|
- lib/ml.rb
|
110
110
|
- ml.gemspec
|
111
|
-
- spec/
|
111
|
+
- spec/data_spec.rb
|
112
|
+
- spec/learner_spec.rb
|
112
113
|
- spec/spec_helper.rb
|
113
114
|
homepage: http://github.com/eggegg/ml
|
114
115
|
licenses:
|
@@ -125,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
126
|
version: '0'
|
126
127
|
segments:
|
127
128
|
- 0
|
128
|
-
hash:
|
129
|
+
hash: -2452539594856608419
|
129
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
131
|
none: false
|
131
132
|
requirements:
|