numo-libsvm 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +3 -2
- data/CHANGELOG.md +3 -0
- data/Gemfile +7 -0
- data/README.md +1 -1
- data/Steepfile +20 -0
- data/lib/numo/libsvm/version.rb +1 -1
- data/numo-libsvm.gemspec +0 -5
- data/sig/numo/libsvm.rbs +65 -0
- data/sig/patch.rbs +8 -0
- metadata +9 -62
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc6e127137e7b4a7b5e6a8477e30cc9e04a5758fb193b033f902960e165b6100
|
4
|
+
data.tar.gz: bdd45b65be32d012b550c7beb1be055d8c0eaf9fff67996621496e80d1895d66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1620a02bd1c7138f4cb2b531673c2c91461525bf3e69f9f98848874abc145b825bd6a5f048e8327dabb97d3e9957359bb28ccbce37f12ba827c2c79ce64d7f5d
|
7
|
+
data.tar.gz: 2d2361b02d760b6e00e80c36f79b74cd0d4267e1584b6bf1f57a0131d481a07c2c57fc682790cb5fd3b4f2e164786abebb7b720d90fa6b9a61bf76d7ea28ad07
|
data/.github/workflows/build.yml
CHANGED
@@ -6,8 +6,9 @@ jobs:
|
|
6
6
|
build:
|
7
7
|
runs-on: ubuntu-latest
|
8
8
|
strategy:
|
9
|
+
fail-fast: false
|
9
10
|
matrix:
|
10
|
-
ruby: [ '2.
|
11
|
+
ruby: [ '2.6', '2.7', '3.0' ]
|
11
12
|
steps:
|
12
13
|
- uses: actions/checkout@v2
|
13
14
|
- name: Checkout submodule
|
@@ -22,6 +23,6 @@ jobs:
|
|
22
23
|
ruby-version: ${{ matrix.ruby }}
|
23
24
|
- name: Build and test with Rake
|
24
25
|
run: |
|
25
|
-
gem install bundler
|
26
|
+
gem install --no-document bundler
|
26
27
|
bundle install --jobs 4 --retry 3
|
27
28
|
bundle exec rake
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -158,7 +158,7 @@ Accuracy: 98.3 %
|
|
158
158
|
### Note
|
159
159
|
The hyperparameter of SVM is given with Ruby Hash on Numo::Libsvm.
|
160
160
|
The hash key of hyperparameter and its meaning match the struct svm_parameter of LIBSVM.
|
161
|
-
The svm_parameter is detailed in [LIBSVM README](https://github.com/cjlin1/libsvm/blob/
|
161
|
+
The svm_parameter is detailed in [LIBSVM README](https://github.com/cjlin1/libsvm/blob/master/README).
|
162
162
|
|
163
163
|
```ruby
|
164
164
|
param = {
|
data/Steepfile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
target :lib do
|
2
|
+
signature "sig"
|
3
|
+
#
|
4
|
+
check "lib" # Directory name
|
5
|
+
# check "Gemfile" # File name
|
6
|
+
# check "app/models/**/*.rb" # Glob
|
7
|
+
# # ignore "lib/templates/*.rb"
|
8
|
+
#
|
9
|
+
# # library "pathname", "set" # Standard libraries
|
10
|
+
# library "numo-narray" # Gems
|
11
|
+
end
|
12
|
+
|
13
|
+
# target :spec do
|
14
|
+
# signature "sig", "sig-private"
|
15
|
+
#
|
16
|
+
# check "spec"
|
17
|
+
#
|
18
|
+
# # library "pathname", "set" # Standard libraries
|
19
|
+
# # library "rspec"
|
20
|
+
# end
|
data/lib/numo/libsvm/version.rb
CHANGED
data/numo-libsvm.gemspec
CHANGED
@@ -47,9 +47,4 @@ Gem::Specification.new do |spec|
|
|
47
47
|
}
|
48
48
|
|
49
49
|
spec.add_runtime_dependency 'numo-narray', '~> 0.9.1'
|
50
|
-
|
51
|
-
spec.add_development_dependency 'bundler', '~> 2.0'
|
52
|
-
spec.add_development_dependency 'rake', '~> 12.0'
|
53
|
-
spec.add_development_dependency 'rake-compiler', '~> 1.0'
|
54
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
55
50
|
end
|
data/sig/numo/libsvm.rbs
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
module Numo
|
2
|
+
module Libsvm
|
3
|
+
module SvmType
|
4
|
+
C_SVC: Integer
|
5
|
+
NU_SVC: Integer
|
6
|
+
ONE_CLASS: Integer
|
7
|
+
EPSILON_SVR: Integer
|
8
|
+
NU_SVR: Integer
|
9
|
+
end
|
10
|
+
|
11
|
+
module KenelType
|
12
|
+
LINEAR: Integer
|
13
|
+
POLY: Integer
|
14
|
+
RBF: Integer
|
15
|
+
SIGMOID: Integer
|
16
|
+
PRECOMPUTED: Integer
|
17
|
+
end
|
18
|
+
|
19
|
+
LIBSVM_VERSION: Integer
|
20
|
+
VERSION: String
|
21
|
+
|
22
|
+
type model = {
|
23
|
+
nr_class: Integer,
|
24
|
+
l: Integer,
|
25
|
+
SV: Numo::DFloat,
|
26
|
+
sv_coef: Numo::DFloat,
|
27
|
+
rho: Numo::DFloat,
|
28
|
+
probA: Numo::DFloat,
|
29
|
+
probB: Numo::DFloat,
|
30
|
+
sv_indices: Numo::Int32,
|
31
|
+
label: Numo::Int32,
|
32
|
+
nSV: Numo::Int32,
|
33
|
+
free_sv: Integer
|
34
|
+
}
|
35
|
+
|
36
|
+
type param = {
|
37
|
+
svm_type: Integer?,
|
38
|
+
kernel_type: Integer?,
|
39
|
+
degree: Integer?,
|
40
|
+
gamma: Float?,
|
41
|
+
coef0: Float?,
|
42
|
+
cache_size: Float?,
|
43
|
+
eps: Float?,
|
44
|
+
C: Float?,
|
45
|
+
nr_weight: Integer?,
|
46
|
+
weight_label: Numo::Int32?,
|
47
|
+
weight: Numo::DFloat?,
|
48
|
+
nu: Float?,
|
49
|
+
p: Float?,
|
50
|
+
shrinking: bool?,
|
51
|
+
probability: bool?,
|
52
|
+
verbose: bool?,
|
53
|
+
random_seed: Integer?
|
54
|
+
}
|
55
|
+
|
56
|
+
def self?.cv: (Numo::DFloat x, Numo::DFloat y, param, Integer n_folds) -> Numo::DFloat
|
57
|
+
def self?.train: (Numo::DFloat x, Numo::DFloat y, param) -> model
|
58
|
+
def self?.predict: (Numo::DFloat x, param, model) -> Numo::DFloat
|
59
|
+
def self?.predict_proba: (Numo::DFloat x, param, model) -> Numo::DFloat
|
60
|
+
def self?.decision_function: (Numo::DFloat x, param, model) -> Numo::DFloat
|
61
|
+
def self?.save_svm_model: (String filename, param, model) -> bool
|
62
|
+
def self?.load_svm_model: (String filename) -> [param, model]
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
data/sig/patch.rbs
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: numo-libsvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshoku
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: numo-narray
|
@@ -24,62 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.9.1
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '2.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '12.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '12.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake-compiler
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3.0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.0'
|
83
27
|
description: |
|
84
28
|
Numo::Libsvm is a Ruby gem binding to the LIBSVM library.
|
85
29
|
LIBSVM is one of the famous libraries that implemented Support Vector Machines,
|
@@ -102,6 +46,7 @@ files:
|
|
102
46
|
- LICENSE.txt
|
103
47
|
- README.md
|
104
48
|
- Rakefile
|
49
|
+
- Steepfile
|
105
50
|
- ext/numo/libsvm/converter.c
|
106
51
|
- ext/numo/libsvm/converter.h
|
107
52
|
- ext/numo/libsvm/extconf.rb
|
@@ -122,6 +67,8 @@ files:
|
|
122
67
|
- lib/numo/libsvm.rb
|
123
68
|
- lib/numo/libsvm/version.rb
|
124
69
|
- numo-libsvm.gemspec
|
70
|
+
- sig/numo/libsvm.rbs
|
71
|
+
- sig/patch.rbs
|
125
72
|
homepage: https://github.com/yoshoku/numo-libsvm
|
126
73
|
licenses:
|
127
74
|
- BSD-3-Clause
|
@@ -129,7 +76,7 @@ metadata:
|
|
129
76
|
homepage_uri: https://github.com/yoshoku/numo-libsvm
|
130
77
|
source_code_uri: https://github.com/yoshoku/numo-libsvm
|
131
78
|
documentation_uri: https://yoshoku.github.io/numo-libsvm/doc/
|
132
|
-
post_install_message:
|
79
|
+
post_install_message:
|
133
80
|
rdoc_options: []
|
134
81
|
require_paths:
|
135
82
|
- lib
|
@@ -144,8 +91,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
91
|
- !ruby/object:Gem::Version
|
145
92
|
version: '0'
|
146
93
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
148
|
-
signing_key:
|
94
|
+
rubygems_version: 3.1.6
|
95
|
+
signing_key:
|
149
96
|
specification_version: 4
|
150
97
|
summary: Numo::Libsvm is a Ruby gem binding to the LIBSVM library. Numo::Libsvm makes
|
151
98
|
to use the LIBSVM functions with dataset represented by Numo::NArray.
|