rumale-ensemble 0.25.0 → 0.26.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: 44cea4359b18d3199caef4522e2e1877da132cea10ed0df24ba3a3d5fa77a726
4
- data.tar.gz: d2773ea7f360aa1b0bb352e9527c99b050b1890b070af98123ac4575d67f5802
3
+ metadata.gz: 8760a2022e71904e7a662c1348ec88cfc99a44adce603f6ea17851641206604d
4
+ data.tar.gz: 524cd4e6f552acc93373dd505fe03a728947d3f0b41e96a3479acd361ae009cf
5
5
  SHA512:
6
- metadata.gz: 79ba3885b8d8d54a5b26d2296ca65d08d1e64d9c59b94d0beb3015990816f85c7670b439e99b80a5b6d07a6f77dc0760368b39fd0736027808fa7244d19ed84c
7
- data.tar.gz: b227f7dc138131281e82bea6f9fa867eac43c7795e01ab7d2f608ccef750b476c8dbd8d766f28b11d458a217216dfefb1f752f6cbd1537bdd4319c1f94e6938b
6
+ metadata.gz: 6e5b5d7544322cbfd5e461c316f585c18204d4728d2b67790a517cfba7a077b86c56ba54e17fc8c5c0a203fe4611ac7119d06d7f058c00c9bf828780f8b70462
7
+ data.tar.gz: cbd2504c15bc18c7c9641bddd52398e88b51c95692ea680ada8d524e31ec2cc8c2bcfd9593f6d37d811942e07537f8fa1dfbacb82fb3d7232f9300f34368642c
@@ -86,7 +86,7 @@ module Rumale
86
86
  @estimators = []
87
87
  @feature_importances = Numo::DFloat.zeros(n_features)
88
88
  @params[:max_features] = n_features unless @params[:max_features].is_a?(Integer)
89
- @params[:max_features] = [[1, @params[:max_features]].max, n_features].min
89
+ @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp
90
90
  @classes = Numo::Int32.asarray(y.to_a.uniq.sort)
91
91
  n_classes = @classes.shape[0]
92
92
  sub_rng = @rng.dup
@@ -93,7 +93,7 @@ module Rumale
93
93
  # Initialize some variables.
94
94
  n_samples, n_features = x.shape
95
95
  @params[:max_features] = n_features unless @params[:max_features].is_a?(Integer)
96
- @params[:max_features] = [[1, @params[:max_features]].max, n_features].min
96
+ @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp
97
97
  observation_weights = Numo::DFloat.zeros(n_samples) + 1.fdiv(n_samples)
98
98
  @estimators = []
99
99
  @estimator_weights = []
@@ -76,7 +76,7 @@ module Rumale
76
76
  # Initialize some variables.
77
77
  n_features = x.shape[1]
78
78
  @params[:max_features] = Math.sqrt(n_features).to_i if @params[:max_features].nil?
79
- @params[:max_features] = [[1, @params[:max_features]].max, n_features].min
79
+ @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp
80
80
  @classes = Numo::Int32.asarray(y.to_a.uniq.sort)
81
81
  sub_rng = @rng.dup
82
82
  # Construct trees.
@@ -72,7 +72,7 @@ module Rumale
72
72
  # Initialize some variables.
73
73
  n_features = x.shape[1]
74
74
  @params[:max_features] = Math.sqrt(n_features).to_i if @params[:max_features].nil?
75
- @params[:max_features] = [[1, @params[:max_features]].max, n_features].min
75
+ @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp
76
76
  sub_rng = @rng.dup
77
77
  # Construct forest.
78
78
  rng_seeds = Array.new(@params[:n_estimators]) { sub_rng.rand(::Rumale::Ensemble::Value::SEED_BASE) }
@@ -97,7 +97,7 @@ module Rumale
97
97
  # initialize some variables.
98
98
  n_features = x.shape[1]
99
99
  @params[:max_features] = n_features if @params[:max_features].nil?
100
- @params[:max_features] = [[1, @params[:max_features]].max, n_features].min
100
+ @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp
101
101
  @classes = Numo::Int32[*y.to_a.uniq.sort]
102
102
  n_classes = @classes.size
103
103
  # train estimator.
@@ -187,7 +187,7 @@ module Rumale
187
187
  # initialize some variables.
188
188
  estimators = []
189
189
  n_samples = x.shape[0]
190
- n_sub_samples = [n_samples, [(n_samples * @params[:subsample]).to_i, 1].max].min
190
+ n_sub_samples = [n_samples, [(n_samples * @params[:subsample]).to_i, 1].max].min # rubocop:disable Style/ComparableClamp
191
191
  whole_ids = Array.new(n_samples) { |v| v }
192
192
  y_pred = Numo::DFloat.ones(n_samples) * init_pred
193
193
  sub_rng = @rng.dup
@@ -88,7 +88,7 @@ module Rumale
88
88
  # initialize some variables.
89
89
  n_features = x.shape[1]
90
90
  @params[:max_features] = n_features if @params[:max_features].nil?
91
- @params[:max_features] = [[1, @params[:max_features]].max, n_features].min
91
+ @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp
92
92
  n_outputs = y.shape[1].nil? ? 1 : y.shape[1]
93
93
  # train regressor.
94
94
  @base_predictions = n_outputs > 1 ? y.mean(0) : y.mean
@@ -141,7 +141,7 @@ module Rumale
141
141
  # initialize some variables.
142
142
  estimators = []
143
143
  n_samples = x.shape[0]
144
- n_sub_samples = [n_samples, [(n_samples * @params[:subsample]).to_i, 1].max].min
144
+ n_sub_samples = [n_samples, [(n_samples * @params[:subsample]).to_i, 1].max].min # rubocop:disable Style/ComparableClamp
145
145
  whole_ids = Array.new(n_samples) { |v| v }
146
146
  y_pred = Numo::DFloat.ones(n_samples) * init_pred
147
147
  sub_rng = @rng.dup
@@ -86,7 +86,7 @@ module Rumale
86
86
  # Initialize some variables.
87
87
  n_samples, n_features = x.shape
88
88
  @params[:max_features] = Math.sqrt(n_features).to_i if @params[:max_features].nil?
89
- @params[:max_features] = [[1, @params[:max_features]].max, n_features].min
89
+ @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp
90
90
  @classes = Numo::Int32.asarray(y.to_a.uniq.sort)
91
91
  sub_rng = @rng.dup
92
92
  rngs = Array.new(@params[:n_estimators]) { Random.new(sub_rng.rand(::Rumale::Ensemble::Value::SEED_BASE)) }
@@ -81,7 +81,7 @@ module Rumale
81
81
  # Initialize some variables.
82
82
  n_samples, n_features = x.shape
83
83
  @params[:max_features] = Math.sqrt(n_features).to_i if @params[:max_features].nil?
84
- @params[:max_features] = [[1, @params[:max_features]].max, n_features].min
84
+ @params[:max_features] = [[1, @params[:max_features]].max, n_features].min # rubocop:disable Style/ComparableClamp
85
85
  single_target = y.shape[1].nil?
86
86
  sub_rng = @rng.dup
87
87
  rngs = Array.new(@params[:n_estimators]) { Random.new(sub_rng.rand(::Rumale::Ensemble::Value::SEED_BASE)) }
@@ -5,6 +5,6 @@ module Rumale
5
5
  # This module consists of the classes that implement ensemble-based methods.
6
6
  module Ensemble
7
7
  # @!visibility private
8
- VERSION = '0.25.0'
8
+ VERSION = '0.26.0'
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rumale-ensemble
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-18 00:00:00.000000000 Z
11
+ date: 2023-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-narray
@@ -30,70 +30,70 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.25.0
33
+ version: 0.26.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.25.0
40
+ version: 0.26.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rumale-linear_model
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.25.0
47
+ version: 0.26.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.25.0
54
+ version: 0.26.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rumale-model_selection
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.25.0
61
+ version: 0.26.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.25.0
68
+ version: 0.26.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rumale-preprocessing
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.25.0
75
+ version: 0.26.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.25.0
82
+ version: 0.26.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rumale-tree
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.25.0
89
+ version: 0.26.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.25.0
96
+ version: 0.26.0
97
97
  description: |
98
98
  Rumale::Ensemble provides ensemble learning algorithms,
99
99
  such as AdaBoost, Gradient Tree Boosting, and Random Forest,