tomz-libsvm-ruby-swig 0.2.2 → 0.2.3
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/Rakefile +8 -4
- data/lib/svm.rb +4 -4
- metadata +2 -2
data/Rakefile
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'hoe'
|
3
3
|
|
4
|
-
task :default => ["make_gem"]
|
4
|
+
task :default => ["sync_files","make_gem"]
|
5
5
|
|
6
|
-
EXT = "ext/
|
6
|
+
EXT = "ext/svm?.#{Hoe::DLEXT}"
|
7
7
|
|
8
|
-
Hoe.new('libsvm-ruby-swig', '0.2.
|
8
|
+
Hoe.new('libsvm-ruby-swig', '0.2.3') do |p|
|
9
9
|
p.author = 'Tom Zeng'
|
10
10
|
p.email = 'tom.z.zeng@gmail.com'
|
11
11
|
p.url = 'http://www.tomzconsulting.com'
|
@@ -25,9 +25,13 @@ file EXT => ["ext/extconf.rb", "ext/svmc_wrap.cxx", "ext/svm.cpp", "ext/svm.h"]
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
task :
|
28
|
+
task :sync_files do
|
29
29
|
cp "libsvm-2.88/svm.h","ext/"
|
30
30
|
cp "libsvm-2.88/svm.cpp","ext/"
|
31
31
|
cp "libsvm-2.88/ruby/svmc_wrap.cxx","ext/"
|
32
32
|
cp "libsvm-2.88/ruby/svm.rb","lib/"
|
33
33
|
end
|
34
|
+
|
35
|
+
task :test do
|
36
|
+
puts "done"
|
37
|
+
end
|
data/lib/svm.rb
CHANGED
@@ -103,7 +103,7 @@ class Parameter
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def _convert_to_svm_node_array(x)
|
106
|
-
# convert a
|
106
|
+
# convert a hash or array to an svm_node array
|
107
107
|
|
108
108
|
# Find non zero elements
|
109
109
|
iter_range = []
|
@@ -117,7 +117,7 @@ def _convert_to_svm_node_array(x)
|
|
117
117
|
iter_range << j #if x[j] != 0
|
118
118
|
}
|
119
119
|
else
|
120
|
-
raise TypeError,"data must be a
|
120
|
+
raise TypeError,"data must be a hash or an array"
|
121
121
|
end
|
122
122
|
|
123
123
|
iter_range.sort
|
@@ -167,7 +167,7 @@ class Problem
|
|
167
167
|
end
|
168
168
|
|
169
169
|
def inspect
|
170
|
-
return "
|
170
|
+
return "Problem: size = #{size}"
|
171
171
|
end
|
172
172
|
|
173
173
|
def destroy
|
@@ -270,7 +270,7 @@ class Model
|
|
270
270
|
count += 1
|
271
271
|
end
|
272
272
|
end
|
273
|
-
return
|
273
|
+
return d
|
274
274
|
end
|
275
275
|
end
|
276
276
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomz-libsvm-ruby-swig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Zeng
|
@@ -45,7 +45,7 @@ files:
|
|
45
45
|
- ext/svm.cpp
|
46
46
|
- ext/svm.h
|
47
47
|
- ext/extconf.rb
|
48
|
-
has_rdoc:
|
48
|
+
has_rdoc: false
|
49
49
|
homepage: http://www.tomzconsulting.com
|
50
50
|
post_install_message:
|
51
51
|
rdoc_options:
|