rumale-svm 0.4.0 → 0.5.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: fb3d059168c39ad2dd1dc2052528b060f0b469165f3d5e60db3a6959a1994637
4
- data.tar.gz: 3a7fa1c8d7445573308413e195426b294ad01c97fec59c345b46bf74b5ff8096
3
+ metadata.gz: 847cb0e3e45d78a4f5d817c645bfc9517dc50e51a06bd934740d6a4bfe73fa7b
4
+ data.tar.gz: fc46b42b3ba883ad3760579333e52b7ada898d951aaebcc8c107cdbb18f7d7a3
5
5
  SHA512:
6
- metadata.gz: 88191bf03ef5ade4eb9d6d927ccbf53a2f0e74789aebbe9616dea472548a28e8e46a0fb6e0a0903c67e84f919e22903830c39cbe8f2a761a183b2a429836ddda
7
- data.tar.gz: a6897776e03bb756f40138984537353ac42643006892fa4ef61d89950478f074f530d0dc57192185f4f72d30768b83619d9cd813a3dab3bdecab5e6034eddb9f
6
+ metadata.gz: 342eff3e5ccb2108f3fb1d0e3625e119b2a88a91682eb01632ebd1b1c0cdc892e6454fad1e9a261bb4353a4ad36177be907b54dfabcccaa99d160eb3923a5b70
7
+ data.tar.gz: 70c2953a3617a07b988e86f2f111241cab30d3e930699d9d8faf7fd5721ed40f9f418848f2dbd37c511dc732e4651fe05067970c0e4d48747bca8e5689bb98ad
data/.coveralls.yml CHANGED
@@ -1 +1 @@
1
- service_name: travis-ci
1
+ service_name: github-ci
@@ -0,0 +1,20 @@
1
+ name: build
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-20.04
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby: [ '2.6', '2.7', '3.0' ]
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Set up Ruby ${{ matrix.ruby }}
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: ${{ matrix.ruby }}
18
+ bundler-cache: true
19
+ - name: Build and test with Rake
20
+ run: bundle exec rake
@@ -0,0 +1,24 @@
1
+ name: coverage
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ coverage:
11
+ runs-on: ubuntu-20.04
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Set up Ruby 2.7
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: '2.7'
18
+ bundler-cache: true
19
+ - name: Build and test with Rake
20
+ run: bundle exec rake
21
+ - name: Coveralls GitHub Action
22
+ uses: coverallsapp/github-action@v1.1.2
23
+ with:
24
+ github-token: ${{ secrets.GITHUB_TOKEN }}
data/.rubocop.yml CHANGED
@@ -1,9 +1,11 @@
1
1
  require:
2
2
  - rubocop-performance
3
+ - rubocop-rake
3
4
  - rubocop-rspec
4
5
 
5
6
  AllCops:
6
- TargetRubyVersion: 2.4
7
+ NewCops: enable
8
+ TargetRubyVersion: 2.5
7
9
  DisplayCopNames: true
8
10
  DisplayStyleGuide: true
9
11
  Exclude:
@@ -105,3 +107,5 @@ RSpec/InstanceVariable:
105
107
  RSpec/LeakyConstantDeclaration:
106
108
  Enabled: false
107
109
 
110
+ RSpec/MultipleMemoizedHelpers:
111
+ Max: 25
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.5.0
2
+ - Add type declaration files.
3
+
1
4
  # 0.4.0
2
5
  - Add linear one-class support vector machine.
3
6
 
data/Gemfile CHANGED
@@ -3,6 +3,13 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in rumale-svm.gemspec
4
4
  gemspec
5
5
 
6
- gem 'coveralls', '~> 0.8'
7
6
  gem 'rake', '~> 12.0'
8
7
  gem 'rspec', '~> 3.0'
8
+ gem 'rubocop', '~> 1.0'
9
+ gem 'rubocop-performance', '~> 1.8'
10
+ gem 'rubocop-rake', '~> 0.5'
11
+ gem 'rubocop-rspec', '~> 2.0'
12
+ gem 'simplecov', '~> 0.21'
13
+ gem 'simplecov-lcov', '~> 0.8'
14
+ gem 'rbs', '~> 1.2'
15
+ gem 'steep', '~> 0.44'
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2019-2020 Atsushi Tatsuma
1
+ Copyright (c) 2019-2021 Atsushi Tatsuma
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Rumale::SVM
2
2
 
3
- [![Build Status](https://travis-ci.org/yoshoku/rumale-svm.svg?branch=master)](https://travis-ci.org/yoshoku/rumale-svm)
4
- [![Coverage Status](https://coveralls.io/repos/github/yoshoku/rumale-svm/badge.svg?branch=master)](https://coveralls.io/github/yoshoku/rumale-svm?branch=master)
3
+ [![Build Status](https://github.com/yoshoku/rumale-svm/workflows/build/badge.svg)](https://github.com/yoshoku/rumale-svm/actions?query=workflow%3Abuild)
4
+ [![Coverage Status](https://coveralls.io/repos/github/yoshoku/rumale-svm/badge.svg?branch=main)](https://coveralls.io/github/yoshoku/rumale-svm?branch=main)
5
5
  [![Gem Version](https://badge.fury.io/rb/rumale-svm.svg)](https://badge.fury.io/rb/rumale-svm)
6
- [![BSD 3-Clause License](https://img.shields.io/badge/License-BSD%203--Clause-orange.svg)](https://github.com/yoshoku/rumale-svm/blob/master/LICENSE.txt)
6
+ [![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)
7
7
  [![Documentation](http://img.shields.io/badge/api-reference-blue.svg)](https://yoshoku.github.io/rumale-svm/doc/)
8
8
 
9
9
  Rumale::SVM provides support vector machine algorithms in
@@ -87,4 +87,4 @@ The gem is available as open source under the terms of the [BSD-3-Clause License
87
87
 
88
88
  ## Code of Conduct
89
89
 
90
- Everyone interacting in the Rumale::Svm project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yoshoku/rumale-svm/blob/master/CODE_OF_CONDUCT.md).
90
+ Everyone interacting in the Rumale::Svm project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yoshoku/rumale-svm/blob/main/CODE_OF_CONDUCT.md).
data/Steepfile ADDED
@@ -0,0 +1,20 @@
1
+ target :lib do
2
+ signature "sig", "sig-deps"
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-libsvm", "numo-liblinear" # 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
@@ -41,9 +41,6 @@ module Rumale
41
41
  @params[:tol] = tol.to_f
42
42
  @params[:verbose] = verbose
43
43
  @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
44
- @weight_vec = nil
45
- @bias_term = nil
46
- @model = nil
47
44
  end
48
45
 
49
46
  # Fit the model with given training data.
@@ -58,10 +58,6 @@ module Rumale
58
58
  @params[:tol] = tol.to_f
59
59
  @params[:verbose] = verbose
60
60
  @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
61
- @model = nil
62
- @weight_vec = nil
63
- @bias_term = nil
64
- @prob_param = nil
65
61
  end
66
62
 
67
63
  # Fit the model with given training data.
@@ -54,9 +54,6 @@ module Rumale
54
54
  @params[:tol] = tol.to_f
55
55
  @params[:verbose] = verbose
56
56
  @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
57
- @model = nil
58
- @weight_vec = nil
59
- @bias_term = nil
60
57
  end
61
58
 
62
59
  # Fit the model with given training data.
@@ -52,9 +52,6 @@ module Rumale
52
52
  @params[:tol] = tol.to_f
53
53
  @params[:verbose] = verbose
54
54
  @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
55
- @model = nil
56
- @weight_vec = nil
57
- @bias_term = nil
58
55
  end
59
56
 
60
57
  # Fit the model with given training data.
@@ -47,7 +47,6 @@ module Rumale
47
47
  @params[:tol] = tol.to_f
48
48
  @params[:verbose] = verbose
49
49
  @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
50
- @model = nil
51
50
  end
52
51
 
53
52
  # Fit the model with given training data.
@@ -45,7 +45,6 @@ module Rumale
45
45
  @params[:tol] = tol.to_f
46
46
  @params[:verbose] = verbose
47
47
  @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
48
- @model = nil
49
48
  end
50
49
 
51
50
  # Fit the model with given training data.
@@ -45,7 +45,6 @@ module Rumale
45
45
  @params[:tol] = tol.to_f
46
46
  @params[:verbose] = verbose
47
47
  @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
48
- @model = nil
49
48
  end
50
49
 
51
50
  # Fit the model with given training data.
@@ -47,7 +47,6 @@ module Rumale
47
47
  @params[:tol] = tol.to_f
48
48
  @params[:verbose] = verbose
49
49
  @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
50
- @model = nil
51
50
  end
52
51
 
53
52
  # Fit the model with given training data.
@@ -48,7 +48,6 @@ module Rumale
48
48
  @params[:tol] = tol.to_f
49
49
  @params[:verbose] = verbose
50
50
  @params[:random_seed] = random_seed.nil? ? nil : random_seed.to_i
51
- @model = nil
52
51
  end
53
52
 
54
53
  # 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 with LIBSVM and LIBLINEAR.
6
6
  module SVM
7
7
  # The version of Rumale-SVM you are using.
8
- VERSION = '0.4.0'
8
+ VERSION = '0.5.0'
9
9
  end
10
10
  end
data/rumale-svm.gemspec CHANGED
@@ -19,13 +19,13 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.metadata['homepage_uri'] = spec.homepage
21
21
  spec.metadata['source_code_uri'] = 'https://github.com/yoshoku/rumale-svm'
22
- spec.metadata['changelog_uri'] = 'https://github.com/yoshoku/rumale-svm/blob/master/CHANGELOG.md'
22
+ spec.metadata['changelog_uri'] = 'https://github.com/yoshoku/rumale-svm/blob/main/CHANGELOG.md'
23
23
  spec.metadata['documentation_uri'] = 'https://yoshoku.github.io/rumale-svm/doc/'
24
24
 
25
25
  # Specify which files should be added to the gem when it is released.
26
26
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
27
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
28
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|sig-deps)/}) }
29
29
  end
30
30
  spec.bindir = 'exe'
31
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -0,0 +1,5 @@
1
+ module Rumale
2
+ module SVM
3
+ VERSION: String
4
+ end
5
+ end
@@ -0,0 +1,24 @@
1
+ module Rumale
2
+ module SVM
3
+ class LinearOneClassSVM
4
+ include Base::BaseEstimator
5
+ include Validation
6
+
7
+ attr_reader weight_vec: Numo::DFloat
8
+ attr_reader bias_term: Float
9
+
10
+ def initialize: (?nu: Float nu, ?reg_param: Float reg_param, ?tol: Float tol,
11
+ ?verbose: bool verbose, ?random_seed: untyped? random_seed) -> void
12
+ def fit: (Numo::DFloat x, ?untyped? _y) -> LinearOneClassSVM
13
+ def decision_function: (Numo::DFloat x) -> Numo::DFloat
14
+ def predict: (Numo::DFloat x) -> Numo::Int32
15
+ def marshal_dump: () -> { params: Hash[Symbol, untyped], model: untyped, weight_vec: Numo::DFloat, bias_term: Float }
16
+ def marshal_load: (untyped obj) -> void
17
+
18
+ private
19
+
20
+ def liblinear_params: () -> untyped
21
+ def trained?: () -> bool
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,37 @@
1
+ module Rumale
2
+ module SVM
3
+ class LinearSVC
4
+ include Base::BaseEstimator
5
+ include Base::Classifier
6
+
7
+ attr_reader weight_vec: Numo::DFloat
8
+ attr_reader bias_term: Numo::DFloat
9
+
10
+ def initialize: (?penalty: String penalty, ?loss: String loss, ?dual: bool dual, ?reg_param: Float reg_param,
11
+ ?fit_bias: bool fit_bias, ?bias_scale: Float bias_scale, ?probability: bool probability,
12
+ ?tol: Float tol, ?verbose: bool verbose, ?random_seed: untyped? random_seed) -> void
13
+ def fit: (Numo::DFloat x, Numo::Int32 y) -> LinearSVC
14
+ def decision_function: (Numo::DFloat x) -> Numo::DFloat
15
+ def predict: (Numo::DFloat x) -> Numo::Int32
16
+ def predict_proba: (Numo::DFloat x) -> Numo::DFloat
17
+ def marshal_dump: () -> { params: Hash[Symbol, untyped], model: untyped, weight_vec: Numo::DFloat, bias_term: Numo::DFloat, prob_param: Numo::DFloat }
18
+ def marshal_load: (Hash[Symbol, untyped] obj) -> void
19
+
20
+ private
21
+
22
+ def expand_feature: (Numo::DFloat x) -> Numo::DFloat
23
+ def weight_and_bias: (Numo::DFloat base_weight) -> [Numo::DFloat, Numo::DFloat]
24
+ def proba_model: (Numo::DFloat df, Numo::Int32 y) -> Numo::DFloat
25
+ def liblinear_params: () -> untyped
26
+ def solver_type: () -> Integer
27
+ def binary_class?: () -> bool
28
+ def fit_probability?: () -> bool
29
+ def fit_bias?: () -> bool
30
+ def bias_scale: () -> Float
31
+ def n_classes: () -> Integer
32
+ def n_features: () -> Integer
33
+ def labels: () -> Numo::Int32
34
+ def trained?: () -> bool
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,29 @@
1
+ module Rumale
2
+ module SVM
3
+ class LinearSVR
4
+ include Base::BaseEstimator
5
+ include Base::Regressor
6
+
7
+ attr_reader weight_vec: Numo::DFloat
8
+ attr_reader bias_term: Numo::DFloat
9
+
10
+ def initialize: (?loss: String loss, ?dual: bool dual, ?reg_param: Float reg_param, ?epsilon: Float epsilon,
11
+ ?fit_bias: bool fit_bias, ?bias_scale: Float bias_scale, ?tol: Float tol,
12
+ ?verbose: bool verbose, ?random_seed: untyped? random_seed) -> void
13
+ def fit: (Numo::DFloat x, Numo::DFloat y) -> LinearSVR
14
+ def predict: (Numo::DFloat x) -> Numo::DFloat
15
+ def marshal_dump: () -> { params: Hash[Symbol, untyped], model: untyped, weight_vec: Numo::DFloat, bias_term: Numo::DFloat }
16
+ def marshal_load: (Hash[Symbol, untyped] obj) -> void
17
+
18
+ private
19
+
20
+ def expand_feature: (Numo::DFloat x) -> Numo::DFloat
21
+ def weight_and_bias: (Numo::DFloat base_weight) -> [Numo::DFloat, Numo::DFloat]
22
+ def liblinear_params: () -> untyped
23
+ def solver_type: () -> Integer
24
+ def fit_bias?: () -> bool
25
+ def bias_scale: () -> Float
26
+ def trained?: () -> bool
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,34 @@
1
+ module Rumale
2
+ module SVM
3
+ class LogisticRegression
4
+ include Base::BaseEstimator
5
+ include Base::Classifier
6
+
7
+ attr_reader weight_vec: Numo::DFloat
8
+ attr_reader bias_term: Numo::DFloat
9
+
10
+ def initialize: (?penalty: String penalty, ?dual: bool dual, ?reg_param: Float reg_param,
11
+ ?fit_bias: bool fit_bias, ?bias_scale: Float bias_scale, ?tol: Float tol,
12
+ ?verbose: bool verbose, ?random_seed: untyped? random_seed) -> void
13
+ def fit: (Numo::DFloat x, Numo::Int32 y) -> LogisticRegression
14
+ def decision_function: (Numo::DFloat x) -> Numo::DFloat
15
+ def predict: (Numo::DFloat x) -> Numo::Int32
16
+ def predict_proba: (Numo::DFloat x) -> Numo::DFloat
17
+ def marshal_dump: () -> { params: Hash[Symbol, untyped], model: untyped, weight_vec: Numo::DFloat, bias_term: Numo::DFloat }
18
+ def marshal_load: (untyped obj) -> void
19
+
20
+ private
21
+
22
+ def expand_feature: (Numo::DFloat x) -> Numo::DFloat
23
+ def weight_and_bias: (Numo::DFloat base_weight) -> [Numo::DFloat, Numo::DFloat]
24
+ def liblinear_params: () -> untyped
25
+ def solver_type: () -> Integer
26
+ def binary_class?: () -> bool
27
+ def fit_bias?: () -> bool
28
+ def bias_scale: () -> Float
29
+ def n_classes: () -> Integer
30
+ def n_features: () -> Integer
31
+ def trained?: () -> bool
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,34 @@
1
+ module Rumale
2
+ module SVM
3
+ class NuSVC
4
+ include Base::BaseEstimator
5
+ include Base::Classifier
6
+
7
+ def initialize: (?nu: Float nu, ?kernel: String kernel, ?degree: Integer degree, ?gamma: Float gamma, ?coef0: Float coef0,
8
+ ?shrinking: bool shrinking, ?probability: bool probability,
9
+ ?cache_size: Float cache_size, ?tol: Float tol,
10
+ ?verbose: bool verbose, ?random_seed: untyped? random_seed) -> void
11
+ def fit: (Numo::DFloat x, Numo::Int32 y) -> NuSVC
12
+ def decision_function: (Numo::DFloat x) -> Numo::DFloat
13
+ def predict: (Numo::DFloat x) -> Numo::Int32
14
+ def predict_proba: (Numo::DFloat x) -> Numo::DFloat
15
+ def marshal_dump: () -> { params: Hash[Symbol, untyped], model: untyped }
16
+ def marshal_load: (untyped obj) -> void
17
+ def support: () -> Numo::Int32
18
+ def support_vectors: () -> Numo::DFloat
19
+ def n_support: () -> Numo::Int32
20
+ def duel_coef: () -> Numo::DFloat
21
+ def intercept: () -> Numo::DFloat
22
+ def prob_a: () -> Numo::DFloat
23
+ def prob_b: () -> Numo::DFloat
24
+
25
+ private
26
+
27
+ def add_index_col: (Numo::DFloat x) -> Numo::DFloat
28
+ def del_index_col: (Numo::DFloat x) -> Numo::DFloat
29
+ def precomputed_kernel?: () -> bool
30
+ def libsvm_params: () -> untyped
31
+ def trained?: () -> bool
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,29 @@
1
+ module Rumale
2
+ module SVM
3
+ class NuSVR
4
+ include Base::BaseEstimator
5
+ include Base::Regressor
6
+
7
+ def initialize: (?nu: Float nu, ?kernel: String kernel, ?degree: Integer degree, ?gamma: Float gamma, ?coef0: Float coef0,
8
+ ?shrinking: bool shrinking, ?cache_size: Float cache_size, ?tol: Float tol,
9
+ ?verbose: bool verbose, ?random_seed: untyped? random_seed) -> void
10
+ def fit: (Numo::DFloat x, Numo::DFloat y) -> NuSVR
11
+ def predict: (Numo::DFloat x) -> Numo::DFloat
12
+ def marshal_dump: () -> { params: Hash[Symbol, untyped], model: untyped }
13
+ def marshal_load: (Hash[Symbol, untyped] obj) -> void
14
+ def support: () -> Numo::Int32
15
+ def support_vectors: () -> Numo::DFloat
16
+ def n_support: () -> Integer
17
+ def duel_coef: () -> Numo::DFloat
18
+ def intercept: () -> Numo::DFloat
19
+
20
+ private
21
+
22
+ def add_index_col: (Numo::DFloat x) -> Numo::DFloat
23
+ def del_index_col: (Numo::DFloat x) -> Numo::DFloat
24
+ def precomputed_kernel?: () -> bool
25
+ def libsvm_params: () -> untyped
26
+ def trained?: () -> bool
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,27 @@
1
+ module Rumale
2
+ module SVM
3
+ class OneClassSVM
4
+ include Base::BaseEstimator
5
+ include Validation
6
+
7
+ def initialize: (?nu: Float nu, ?kernel: String kernel, ?degree: Integer degree, ?gamma: Float gamma, ?coef0: Float coef0,
8
+ ?shrinking: bool shrinking, ?cache_size: Float cache_size, ?tol: Float tol,
9
+ ?verbose: bool verbose, ?random_seed: untyped? random_seed) -> void
10
+ def fit: (Numo::DFloat x, ?untyped? _y) -> OneClassSVM
11
+ def decision_function: (Numo::DFloat x) -> Numo::DFloat
12
+ def predict: (Numo::DFloat x) -> Numo::Int32
13
+ def marshal_dump: () -> { params: Hash[Symbol, untyped], model: untyped }
14
+ def marshal_load: (Hash[Symbol, untyped] obj) -> void
15
+ def support: () -> Numo::Int32
16
+ def support_vectors: () -> Numo::DFloat
17
+ def n_support: () -> Integer
18
+ def duel_coef: () -> Numo::DFloat
19
+ def intercept: () -> Numo::DFloat
20
+
21
+ private
22
+
23
+ def libsvm_params: () -> untyped
24
+ def trained?: () -> bool
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,34 @@
1
+ module Rumale
2
+ module SVM
3
+ class SVC
4
+ include Base::BaseEstimator
5
+ include Base::Classifier
6
+
7
+ def initialize: (?reg_param: Float reg_param, ?kernel: String kernel, ?degree: Integer degree, ?gamma: Float gamma,
8
+ ?coef0: Float coef0, ?shrinking: bool shrinking, ?probability: bool probability,
9
+ ?cache_size: Float cache_size, ?tol: Float tol,
10
+ ?verbose: bool verbose, ?random_seed: untyped? random_seed) -> void
11
+ def fit: (Numo::DFloat x, Numo::Int32 y) -> SVC
12
+ def decision_function: (Numo::DFloat x) -> Numo::DFloat
13
+ def predict: (Numo::DFloat x) -> Numo::Int32
14
+ def predict_proba: (Numo::DFloat x) -> Numo::DFloat
15
+ def marshal_dump: () -> { params: Hash[Symbol, untyped], model: untyped }
16
+ def marshal_load: (Hash[Symbol, untyped] obj) -> nil
17
+ def support: () -> Numo::Int32
18
+ def support_vectors: () -> Numo::DFloat
19
+ def n_support: () -> Numo::Int32
20
+ def duel_coef: () -> Numo::DFloat
21
+ def intercept: () -> Numo::DFloat
22
+ def prob_a: () -> Numo::DFloat
23
+ def prob_b: () -> Numo::DFloat
24
+
25
+ private
26
+
27
+ def add_index_col: (Numo::DFloat x) -> Numo::DFloat
28
+ def del_index_col: (Numo::DFloat x) -> Numo::DFloat
29
+ def precomputed_kernel?: () -> bool
30
+ def libsvm_params: () -> untyped
31
+ def trained?: () -> bool
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,30 @@
1
+ module Rumale
2
+ module SVM
3
+ class SVR
4
+ include Base::BaseEstimator
5
+ include Base::Regressor
6
+
7
+ def initialize: (?reg_param: Float reg_param, ?epsilon: Float epsilon, ?kernel: String kernel, ?degree: Integer degree,
8
+ ?gamma: Float gamma, ?coef0: Float coef0, ?shrinking: bool shrinking,
9
+ ?cache_size: Float cache_size, ?tol: Float tol,
10
+ ?verbose: bool verbose, ?random_seed: untyped? random_seed) -> void
11
+ def fit: (Numo::DFloat x, Numo::DFloat y) -> SVR
12
+ def predict: (Numo::DFloat x) -> Numo::DFloat
13
+ def marshal_dump: () -> { params: Hash[Symbol, untyped], model: untyped }
14
+ def marshal_load: (Hash[Symbol, untyped] obj) -> void
15
+ def support: () -> Numo::Int32
16
+ def support_vectors: () -> Numo::DFloat
17
+ def n_support: () -> Integer
18
+ def duel_coef: () -> Numo::DFloat
19
+ def intercept: () -> Numo::DFloat
20
+
21
+ private
22
+
23
+ def add_index_col: (Numo::DFloat x) -> Numo::DFloat
24
+ def del_index_col: (Numo::DFloat x) -> Numo::DFloat
25
+ def precomputed_kernel?: () -> bool
26
+ def libsvm_params: () -> untyped
27
+ def trained?: () -> bool
28
+ end
29
+ end
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumale-svm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.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: 2020-08-14 00:00:00.000000000 Z
11
+ date: 2021-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-liblinear
@@ -55,7 +55,7 @@ dependencies:
55
55
  description: 'Rumale-SVM provides support vector machine algorithms of LIBSVM and
56
56
  LIBLINEAR with Rumale interface.
57
57
 
58
- '
58
+ '
59
59
  email:
60
60
  - yoshoku@outlook.com
61
61
  executables: []
@@ -63,16 +63,18 @@ extensions: []
63
63
  extra_rdoc_files: []
64
64
  files:
65
65
  - ".coveralls.yml"
66
+ - ".github/workflows/build.yml"
67
+ - ".github/workflows/coverage.yml"
66
68
  - ".gitignore"
67
69
  - ".rspec"
68
70
  - ".rubocop.yml"
69
- - ".travis.yml"
70
71
  - CHANGELOG.md
71
72
  - CODE_OF_CONDUCT.md
72
73
  - Gemfile
73
74
  - LICENSE.txt
74
75
  - README.md
75
76
  - Rakefile
77
+ - Steepfile
76
78
  - lib/rumale/svm.rb
77
79
  - lib/rumale/svm/linear_one_class_svm.rb
78
80
  - lib/rumale/svm/linear_svc.rb
@@ -85,15 +87,25 @@ files:
85
87
  - lib/rumale/svm/svr.rb
86
88
  - lib/rumale/svm/version.rb
87
89
  - rumale-svm.gemspec
90
+ - sig/rumale/svm.rbs
91
+ - sig/rumale/svm/linear_one_class_svm.rbs
92
+ - sig/rumale/svm/linear_svc.rbs
93
+ - sig/rumale/svm/linear_svr.rbs
94
+ - sig/rumale/svm/logistic_regression.rbs
95
+ - sig/rumale/svm/nu_svc.rbs
96
+ - sig/rumale/svm/nu_svr.rbs
97
+ - sig/rumale/svm/one_class_svm.rbs
98
+ - sig/rumale/svm/svc.rbs
99
+ - sig/rumale/svm/svr.rbs
88
100
  homepage: https://github.com/yoshoku/rumale-svm
89
101
  licenses:
90
102
  - BSD-3-Clause
91
103
  metadata:
92
104
  homepage_uri: https://github.com/yoshoku/rumale-svm
93
105
  source_code_uri: https://github.com/yoshoku/rumale-svm
94
- changelog_uri: https://github.com/yoshoku/rumale-svm/blob/master/CHANGELOG.md
106
+ changelog_uri: https://github.com/yoshoku/rumale-svm/blob/main/CHANGELOG.md
95
107
  documentation_uri: https://yoshoku.github.io/rumale-svm/doc/
96
- post_install_message:
108
+ post_install_message:
97
109
  rdoc_options: []
98
110
  require_paths:
99
111
  - lib
@@ -108,8 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
120
  - !ruby/object:Gem::Version
109
121
  version: '0'
110
122
  requirements: []
111
- rubygems_version: 3.1.2
112
- signing_key:
123
+ rubygems_version: 3.2.21
124
+ signing_key:
113
125
  specification_version: 4
114
126
  summary: Rumale-SVM provides support vector machine algorithms of LIBSVM and LIBLINEAR
115
127
  with Rumale interface.
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- ---
2
- os: linux
3
- dist: bionic
4
- language: ruby
5
- cache: bundler
6
- rvm:
7
- - '2.4'
8
- - '2.5'
9
- - '2.6'
10
- - '2.7'
11
-
12
- before_install:
13
- - gem install bundler -v 2.0.2