rumale-svm 0.12.0 → 1.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb43a42ed2be607317dde53e4f81788309aa27e28d1c169419e6e0d0cce073af
4
- data.tar.gz: fe1ba15cd33b364a73b249e83c1b4a6937f50b5d7424db49957c2b4ca87c9267
3
+ metadata.gz: 1fc7d42ba72e3d28a3f4b4edb3df1bc409f04a7db361250f36d6e56317be51ee
4
+ data.tar.gz: d849ebbb6256a4cdedd902fc67fe71a57b333f93019b51ec4332afdcc2bfb9b1
5
5
  SHA512:
6
- metadata.gz: 4aad8ec437d6522fbd3d90167a80a463d11b19ff60ee00d90d4a4f8810ee25a615592f2d5caeaf22fe9504aad9189f87c332626c27ef1f8de0f70c15b1908b51
7
- data.tar.gz: d2b12aab3a83ba1ad71d89e49499b007f3054dbc0e49402b4a00ffc238450ade1701edb46bbd7d276dd231cd471831d2db62c210e4b76a096dc02a072c202796
6
+ metadata.gz: 1768024ea0973b9c8e93371396d0554d08e5f8f2c22e5399ebe84fc5436afd5403ff884a562bd1f3ff70aa95adfafaaddb72f9f087eba1079cd81739c434ab0e
7
+ data.tar.gz: 37c0c98eb262fb6a714c29c65375b93e8f31a4153f06bbad8175b0e0c4cf7a8b3c1d6126085062df29f15c22765f49cff7a1ef0d7ee799b90768f3c670450c8d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [[1.0.0](https://github.com/yoshoku/rumale-svm/compare/v0.12.0...v1.0.0)]
2
+
3
+ - Update numo-libsvm and numo-liblinear to v3.0.
4
+ - Update rumale-core to v2.0.
5
+
6
+ Note: With these changes, the rumale-svm now depends on [numo-narray-alt](https://github.com/yoshoku/numo-narray-alt) instead of numo-narray.
7
+
1
8
  # [[0.12.0](https://github.com/yoshoku/rumale-svm/compare/v0.11.0...v0.12.0)]
2
9
  - Fix the version specification of rumale-core gem.
3
10
 
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Build Status](https://github.com/yoshoku/rumale-svm/workflows/build/badge.svg)](https://github.com/yoshoku/rumale-svm/actions?query=workflow%3Abuild)
4
4
  [![Gem Version](https://badge.fury.io/rb/rumale-svm.svg)](https://badge.fury.io/rb/rumale-svm)
5
5
  [![BSD 3-Clause License](https://img.shields.io/badge/License-BSD%203--Clause-orange.svg)](https://github.com/yoshoku/rumale-svm/blob/main/LICENSE.txt)
6
- [![Documentation](https://img.shields.io/badge/api-reference-blue.svg)](https://yoshoku.github.io/rumale-svm/doc/)
6
+ [![Documentation](https://img.shields.io/badge/api-reference-blue.svg)](https://gemdocs.org/gems/rumale-svm/)
7
7
 
8
8
  Rumale::SVM provides support vector machine algorithms using
9
9
  [LIBSVM](https://www.csie.ntu.edu.tw/~cjlin/libsvm/) and [LIBLINEAR](https://www.csie.ntu.edu.tw/~cjlin/liblinear/)
@@ -117,7 +117,7 @@ module Rumale
117
117
  z[true, 0...n_features] = 1.fdiv(Math.sqrt(@params[:reg_param_global])) * x
118
118
  @params[:n_clusters].times do |n|
119
119
  assigned_bits = cluster_ids.eq(n)
120
- z[assigned_bits.where, n_features * (n + 1)...n_features * (n + 2)] = x[assigned_bits.where, true]
120
+ z[assigned_bits.where, (n_features * (n + 1))...(n_features * (n + 2))] = x[assigned_bits.where, true]
121
121
  end
122
122
 
123
123
  z
@@ -35,7 +35,7 @@ module Rumale
35
35
  @params[:reg_param] = reg_param.to_f
36
36
  @params[:tol] = tol.to_f
37
37
  @params[:verbose] = verbose
38
- @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
38
+ @params[:random_seed] = random_seed&.to_i
39
39
  end
40
40
 
41
41
  # Fit the model with given training data.
@@ -54,7 +54,7 @@ module Rumale
54
54
  @params[:probability] = probability
55
55
  @params[:tol] = tol.to_f
56
56
  @params[:verbose] = verbose
57
- @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
57
+ @params[:random_seed] = random_seed&.to_i
58
58
  end
59
59
 
60
60
  # Fit the model with given training data.
@@ -50,7 +50,7 @@ module Rumale
50
50
  @params[:bias_scale] = bias_scale.to_f
51
51
  @params[:tol] = tol.to_f
52
52
  @params[:verbose] = verbose
53
- @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
53
+ @params[:random_seed] = random_seed&.to_i
54
54
  end
55
55
 
56
56
  # Fit the model with given training data.
@@ -9,13 +9,13 @@ require 'rumale/validation'
9
9
  module Rumale
10
10
  module SVM
11
11
  # LocallyLinearSVC is a class that implements Locally Linear Support Vector Classifier with the squared hinge loss.
12
- # This classifier requires Numo::Linalg (or Numo::TinyLinalg) and Lbfgsb gems,
12
+ # This classifier requires numo-linalg-alt and numo-optimize gems,
13
13
  # but they are listed in the runtime dependencies of Rumale::SVM.
14
- # Therefore, you should install and load Numo::Linalg and Lbfgsb gems explicitly to use this classifier.
14
+ # Therefore, you should install and load numo-linalg-alt and numo-optimize gems explicitly to use this classifier.
15
15
  #
16
16
  # @example
17
- # require 'numo/linalg/autoloader'
18
- # require 'lbfgsb'
17
+ # require 'numo/linalg'
18
+ # require 'numo/optimize'
19
19
  # require 'rumale/svm'
20
20
  #
21
21
  # estimator = Rumale::SVM::LocallyLinearSVC.new(reg_param: 1.0, n_anchors: 128)
@@ -82,7 +82,7 @@ module Rumale
82
82
  x = Rumale::Validation.check_convert_sample_array(x)
83
83
  y = Rumale::Validation.check_convert_label_array(y)
84
84
  Rumale::Validation.check_sample_size(x, y)
85
- raise 'LocallyLinearSVC#fit requires Lbfgsb but that is not loaded' unless defined?(Lbfgsb)
85
+ raise 'LocallyLinearSVC#fit requires numo-optimize but that is not loaded' unless defined?(Numo::Optimize)
86
86
 
87
87
  @classes = Numo::Int32[*y.to_a.uniq.sort]
88
88
 
@@ -188,9 +188,9 @@ module Rumale
188
188
  sub_rng = @rng.dup
189
189
  w_init = 2.0 * ::Rumale::Utils.rand_uniform(@params[:n_anchors] * n_features, sub_rng) - 1.0
190
190
 
191
- res = Lbfgsb.minimize(
191
+ res = Numo::Optimize.minimize(
192
192
  fnc: fnc, jcb: true, x_init: w_init, args: [base_x, bin_y, @coeff, @params[:reg_param]],
193
- maxiter: @params[:max_iter], factr: @params[:tol] / Lbfgsb::DBL_EPSILON,
193
+ maxiter: @params[:max_iter], factr: @params[:tol] / Numo::Optimize::Lbfgsb::DBL_EPSILON,
194
194
  verbose: @params[:verbose] ? 1 : -1
195
195
  )
196
196
 
@@ -47,7 +47,7 @@ module Rumale
47
47
  @params[:bias_scale] = bias_scale.to_f
48
48
  @params[:tol] = tol.to_f
49
49
  @params[:verbose] = verbose
50
- @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
50
+ @params[:random_seed] = random_seed&.to_i
51
51
  end
52
52
 
53
53
  # Fit the model with given training data.
@@ -43,7 +43,7 @@ module Rumale
43
43
  @params[:cache_size] = cache_size.to_f
44
44
  @params[:tol] = tol.to_f
45
45
  @params[:verbose] = verbose
46
- @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
46
+ @params[:random_seed] = random_seed&.to_i
47
47
  end
48
48
 
49
49
  # Fit the model with given training data.
@@ -41,7 +41,7 @@ module Rumale
41
41
  @params[:cache_size] = cache_size.to_f
42
42
  @params[:tol] = tol.to_f
43
43
  @params[:verbose] = verbose
44
- @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
44
+ @params[:random_seed] = random_seed&.to_i
45
45
  end
46
46
 
47
47
  # Fit the model with given training data.
@@ -40,7 +40,7 @@ module Rumale
40
40
  @params[:cache_size] = cache_size.to_f
41
41
  @params[:tol] = tol.to_f
42
42
  @params[:verbose] = verbose
43
- @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
43
+ @params[:random_seed] = random_seed&.to_i
44
44
  end
45
45
 
46
46
  # Fit the model with given training data.
@@ -43,7 +43,7 @@ module Rumale
43
43
  @params[:cache_size] = cache_size.to_f
44
44
  @params[:tol] = tol.to_f
45
45
  @params[:verbose] = verbose
46
- @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
46
+ @params[:random_seed] = random_seed&.to_i
47
47
  end
48
48
 
49
49
  # Fit the model with given training data.
@@ -43,7 +43,7 @@ module Rumale
43
43
  @params[:cache_size] = cache_size.to_f
44
44
  @params[:tol] = tol.to_f
45
45
  @params[:verbose] = verbose
46
- @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
46
+ @params[:random_seed] = random_seed&.to_i
47
47
  end
48
48
 
49
49
  # Fit the model with given training data.
@@ -5,6 +5,6 @@ module Rumale
5
5
  # This module consists of Rumale interfaces for suppor vector machine algorithms using LIBSVM and LIBLINEAR.
6
6
  module SVM
7
7
  # The version of Rumale::SVM you are using.
8
- VERSION = '0.12.0'
8
+ VERSION = '1.0.0'
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumale-svm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-02 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: numo-liblinear
@@ -15,42 +15,42 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '2.0'
18
+ version: '3.0'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: '2.0'
25
+ version: '3.0'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: numo-libsvm
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: '2.1'
32
+ version: '3.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '2.1'
39
+ version: '3.0'
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rumale-core
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">="
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.24'
46
+ version: '2.0'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.24'
53
+ version: '2.0'
54
54
  description: 'Rumale::SVM provides support vector machine algorithms using LIBSVM
55
55
  and LIBLINEAR with Rumale interface.
56
56
 
@@ -98,7 +98,7 @@ metadata:
98
98
  homepage_uri: https://github.com/yoshoku/rumale-svm
99
99
  source_code_uri: https://github.com/yoshoku/rumale-svm
100
100
  changelog_uri: https://github.com/yoshoku/rumale-svm/blob/main/CHANGELOG.md
101
- documentation_uri: https://yoshoku.github.io/rumale-svm/doc/
101
+ documentation_uri: https://gemdocs.org/gems/rumale-svm/1.0.0/
102
102
  rubygems_mfa_required: 'true'
103
103
  rdoc_options: []
104
104
  require_paths:
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.6.2
117
+ rubygems_version: 3.6.9
118
118
  specification_version: 4
119
119
  summary: Rumale::SVM provides support vector machine algorithms using LIBSVM and LIBLINEAR
120
120
  with Rumale interface.