numo-liblinear 1.1.2 → 1.2.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: 7938dffc0715abee4a64bbbc91434f9d4fbc075b442443d443cfc84c98676792
4
- data.tar.gz: 280c66c821e95c06832902cefe3eae82931fed7cd9c99a56c9119149877b21f7
3
+ metadata.gz: 3c7b3a307060c75a2b5580fdf89083fd8dccd1423b8ad9d615d5546d21c6f437
4
+ data.tar.gz: 86d810729c58f5725f6ce3cfb7cd56d6b65218071754802649b28bfe06dfbb10
5
5
  SHA512:
6
- metadata.gz: d3535760b9f5089c3bc4a46299385e0e0ba77ffc126cd6c9c64e02e00e17ed57ed8c48096773b0fc783203514d525edbc104dda50dd2ab60d592481ea84bd052
7
- data.tar.gz: 173e630b063820b0b34727e1b8371f22fd67916bdd4e374d23cabeaa61cccad868ff3b0d618c71d55d564e6a05f54eb879a887bda98ccaca786b946a3ae04851
6
+ metadata.gz: f8ddcafa60ffa41c891312c470a44661cec27d5ed8cdbb9bb9efb7a0989e2399176ae37f5f645f0bc3911906fd29e790638d56b7234a59b8345af5005fa7c931
7
+ data.tar.gz: 27ebaf6df54989ba885dfce945aeee8e77fbbe29eef756e42b3ed3db9de0147ecc1cbdb36d572d9f9dceb406e5dac5b42302c7a96713d6dd14351673319a44d6
@@ -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.2.0
2
+ - Add type declaration file: sig/numo/liblinear.rbs
3
+
1
4
  # 1.1.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-liblinear.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
@@ -148,7 +148,7 @@ Accuracy: 87.9 %
148
148
  ## Note
149
149
  The hyperparemter of LIBLINEAR is given with Ruby Hash on Numo::Liblinear.
150
150
  The hash key of hyperparameter and its meaning match the struct parameter of LIBLINEAR.
151
- The parameter is detailed in [LIBLINEAR README](https://github.com/cjlin1/liblinear/blob/main/README)
151
+ The parameter is detailed in [LIBLINEAR README](https://github.com/cjlin1/liblinear/blob/master/README)
152
152
 
153
153
  ```ruby
154
154
  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 Liblinear
5
5
  # The version of Numo::Liblienar you are using.
6
- VERSION = '1.1.2'
6
+ VERSION = '1.2.0'
7
7
  end
8
8
  end
@@ -46,9 +46,4 @@ Gem::Specification.new do |spec|
46
46
  }
47
47
 
48
48
  spec.add_runtime_dependency 'numo-narray', '~> 0.9.1'
49
-
50
- spec.add_development_dependency 'bundler', '~> 2.0'
51
- spec.add_development_dependency 'rake', '~> 12.0'
52
- spec.add_development_dependency 'rake-compiler', '~> 1.0'
53
- spec.add_development_dependency 'rspec', '~> 3.0'
54
49
  end
@@ -0,0 +1,52 @@
1
+ module Numo
2
+ module Liblinear
3
+ module SolverType
4
+ L2R_LR: Integer
5
+ L2R_L2LOSS_SVC_DUAL: Integer
6
+ L2R_L2LOSS_SVC: Integer
7
+ L2R_L1LOSS_SVC_DUAL: Integer
8
+ MCSVM_CS: Integer
9
+ L1R_L2LOSS_SVC: Integer
10
+ L1R_LR: Integer
11
+ L2R_LR_DUAL: Integer
12
+ L2R_L2LOSS_SVR: Integer
13
+ L2R_L2LOSS_SVR_DUAL: Integer
14
+ L2R_L1LOSS_SVR_DUAL: Integer
15
+ ONECLASS_SVM: Integer
16
+ end
17
+
18
+ LIBLINEAR_VERSION: Integer
19
+ VERSION: String
20
+
21
+ type model = {
22
+ nr_class: Integer,
23
+ nr_feature: Integer,
24
+ w: Numo::DFloat,
25
+ label: Numo::Int32,
26
+ bias: Float,
27
+ rho: Float
28
+ }
29
+
30
+ type param = {
31
+ solver_type: Integer?,
32
+ eps: Float?,
33
+ C: Float?,
34
+ nr_weight: Integer?,
35
+ weight_label: Numo::Int32?,
36
+ weight: Numo::DFloat?,
37
+ p: Float?,
38
+ nu: Float?,
39
+ verbose: bool?,
40
+ random_seed: Integer?
41
+ }
42
+
43
+ def self?.cv: (Numo::DFloat x, Numo::DFloat y, param, Integer n_folds) -> Numo::DFloat
44
+ def self?.train: (Numo::DFloat x, Numo::DFloat y, param) -> model
45
+ def self?.predict: (Numo::DFloat x, param, model) -> Numo::DFloat
46
+ def self?.predict_proba: (Numo::DFloat x, param, model) -> Numo::DFloat
47
+ def self?.decision_function: (Numo::DFloat x, param, model) -> Numo::DFloat
48
+ def self?.save_model: (String filename, param, model) -> bool
49
+ def self?.load_model: (String filename) -> [param, model]
50
+ end
51
+ end
52
+
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-liblinear
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.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-06 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::Liblinear is a Ruby gem binding to the LIBLINEAR library.
85
29
  LIBLINEAR is one of the famous libraries for large-scale regularized linear classification and regression.
@@ -101,6 +45,7 @@ files:
101
45
  - LICENSE.txt
102
46
  - README.md
103
47
  - Rakefile
48
+ - Steepfile
104
49
  - ext/numo/liblinear/converter.c
105
50
  - ext/numo/liblinear/converter.h
106
51
  - ext/numo/liblinear/extconf.rb
@@ -127,6 +72,8 @@ files:
127
72
  - lib/numo/liblinear.rb
128
73
  - lib/numo/liblinear/version.rb
129
74
  - numo-liblinear.gemspec
75
+ - sig/numo/liblinear.rbs
76
+ - sig/patch.rbs
130
77
  homepage: https://github.com/yoshoku/numo-liblinear
131
78
  licenses:
132
79
  - BSD-3-Clause
@@ -134,7 +81,7 @@ metadata:
134
81
  homepage_uri: https://github.com/yoshoku/numo-liblinear
135
82
  source_code_uri: https://github.com/yoshoku/numo-liblinear
136
83
  documentation_uri: https://yoshoku.github.io/numo-liblinear/doc/
137
- post_install_message:
84
+ post_install_message:
138
85
  rdoc_options: []
139
86
  require_paths:
140
87
  - lib
@@ -149,8 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
96
  - !ruby/object:Gem::Version
150
97
  version: '0'
151
98
  requirements: []
152
- rubygems_version: 3.2.3
153
- signing_key:
99
+ rubygems_version: 3.1.6
100
+ signing_key:
154
101
  specification_version: 4
155
102
  summary: Numo::Liblinear is a Ruby gem binding to the LIBLINEAR library. Numo::Liblinear
156
103
  makes to use the LIBLINEAR functions with dataset represented by Numo::NArray.