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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d72a8a48f52a71000c0ff4b1202684a8929a8e34b3004f5f142cccbd9af1e034
4
- data.tar.gz: 7c8f38da980376b9ca84191235e10cf98bd9ff44ab546ee3b52d105b57cb4ec7
3
+ metadata.gz: fc6e127137e7b4a7b5e6a8477e30cc9e04a5758fb193b033f902960e165b6100
4
+ data.tar.gz: bdd45b65be32d012b550c7beb1be055d8c0eaf9fff67996621496e80d1895d66
5
5
  SHA512:
6
- metadata.gz: 795830bf885ba8164bb95619eb713cd3b893c61c0c3b1f43de66afb7d3632383054e1ca6870d48ca8a69f0b1fc2007e42b5e37ab67ef14848dd7a471c4d195d2
7
- data.tar.gz: 41388d1b428d3e4e7a181149cc53a7b1654af3b61961dce67948b86ef54fb96eb24e626d1ffe2645fc59886e37d44ec3ba20333c2e17cab5446513d65f205e8c
6
+ metadata.gz: 1620a02bd1c7138f4cb2b531673c2c91461525bf3e69f9f98848874abc145b825bd6a5f048e8327dabb97d3e9957359bb28ccbce37f12ba827c2c79ce64d7f5d
7
+ data.tar.gz: 2d2361b02d760b6e00e80c36f79b74cd0d4267e1584b6bf1f57a0131d481a07c2c57fc682790cb5fd3b4f2e164786abebb7b720d90fa6b9a61bf76d7ea28ad07
@@ -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.5', '2.6', '2.7' ]
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
@@ -1,3 +1,6 @@
1
+ # 1.1.0
2
+ - Add type declaration file: sig/numo/libsvm.rbs
3
+
1
4
  # 1.0.2
2
5
  - Add GC guard to model saving and loading methods.
3
6
  - Fix size specification to memcpy function.
data/Gemfile CHANGED
@@ -2,3 +2,10 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in numo-libsvm.gemspec
4
4
  gemspec
5
+
6
+ gem 'bundler', '~> 2.0'
7
+ gem 'rake', '~> 13.0'
8
+ gem 'rake-compiler', '~> 1.0'
9
+ gem 'rspec', '~> 3.0'
10
+ gem 'rbs', '~> 1.2'
11
+ gem 'steep', '~> 0.44'
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/main/README).
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
@@ -3,6 +3,6 @@
3
3
  module Numo
4
4
  module Libsvm
5
5
  # The version of Numo::Libsvm you are using.
6
- VERSION = '1.0.2'
6
+ VERSION = '1.1.0'
7
7
  end
8
8
  end
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
@@ -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
@@ -0,0 +1,8 @@
1
+ module Numo
2
+ class NArray
3
+ end
4
+ class DFloat < NArray
5
+ end
6
+ class Int32 < NArray
7
+ end
8
+ end
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.2
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-01-23 00:00:00.000000000 Z
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.2.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.