rumale-ensemble 0.24.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: 71f67ae6338e6907a02b66affa8ad12b22254da82d6a1fdfea092844f8809a51
4
- data.tar.gz: 7b301905c59c580ace8f17edc4dd2b526af267493f60f74c294652f6e137fc12
3
+ metadata.gz: 8760a2022e71904e7a662c1348ec88cfc99a44adce603f6ea17851641206604d
4
+ data.tar.gz: 524cd4e6f552acc93373dd505fe03a728947d3f0b41e96a3479acd361ae009cf
5
5
  SHA512:
6
- metadata.gz: 65391ee173334b7b2bc41761fe4a66dd8bd0c1158c948187b9059b78b80c9343393e3a42d52e6906e54388e7e3ce86340eb479a3c443130bdf004b1954570853
7
- data.tar.gz: 7f78362e3a06aacc18f1a71a0c0340a5322fd8d78a2acd74ac7e4a8b4bfcd9396b84cfa0dc2a01ad1f872ff057b6847b7cd6c06d3bbab45f0fc9087035715d11
6
+ metadata.gz: 6e5b5d7544322cbfd5e461c316f585c18204d4728d2b67790a517cfba7a077b86c56ba54e17fc8c5c0a203fe4611ac7119d06d7f058c00c9bf828780f8b70462
7
+ data.tar.gz: cbd2504c15bc18c7c9641bddd52398e88b51c95692ea680ada8d524e31ec2cc8c2bcfd9593f6d37d811942e07537f8fa1dfbacb82fb3d7232f9300f34368642c
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2022 Atsushi Tatsuma
1
+ Copyright (c) 2022-2023 Atsushi Tatsuma
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
@@ -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)) }
@@ -15,11 +15,11 @@ module Rumale
15
15
  # require 'rumale/ensemble/stacking_classifier'
16
16
  #
17
17
  # estimators = {
18
- # lgr: Rumale::LinearModel::LogisticRegression.new(reg_param: 1e-2, random_seed: 1),
18
+ # lgr: Rumale::LinearModel::LogisticRegression.new(reg_param: 1e-2),
19
19
  # mlp: Rumale::NeuralNetwork::MLPClassifier.new(hidden_units: [256], random_seed: 1),
20
20
  # rnd: Rumale::Ensemble::RandomForestClassifier.new(random_seed: 1)
21
21
  # }
22
- # meta_estimator = Rumale::LinearModel::LogisticRegression.new(random_seed: 1)
22
+ # meta_estimator = Rumale::LinearModel::LogisticRegression.new
23
23
  # classifier = Rumale::Ensemble::StackedClassifier.new(
24
24
  # estimators: estimators, meta_estimator: meta_estimator, random_seed: 1
25
25
  # )
@@ -18,7 +18,7 @@ module Rumale
18
18
  # mlp: Rumale::NeuralNetwork::MLPRegressor.new(hidden_units: [256], random_seed: 1),
19
19
  # rnd: Rumale::Ensemble::RandomForestRegressor.new(random_seed: 1)
20
20
  # }
21
- # meta_estimator = Rumale::LinearModel::Ridge.new(random_seed: 1)
21
+ # meta_estimator = Rumale::LinearModel::Ridge.new
22
22
  # regressor = Rumale::Ensemble::StackedRegressor.new(
23
23
  # estimators: estimators, meta_estimator: meta_estimator, random_seed: 1
24
24
  # )
@@ -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.24.0'
8
+ VERSION = '0.26.0'
9
9
  end
10
10
  end
@@ -13,7 +13,7 @@ module Rumale
13
13
  # require 'rumale/ensemble/voting_classifier'
14
14
  #
15
15
  # estimators = {
16
- # lgr: Rumale::LinearModel::LogisticRegression.new(reg_param: 1e-2, random_seed: 1),
16
+ # lgr: Rumale::LinearModel::LogisticRegression.new(reg_param: 1e-2),
17
17
  # mlp: Rumale::NeuralNetwork::MLPClassifier.new(hidden_units: [256], random_seed: 1),
18
18
  # rnd: Rumale::Ensemble::RandomForestClassifier.new(random_seed: 1)
19
19
  # }
@@ -12,7 +12,7 @@ module Rumale
12
12
  # require 'rumale/ensemble/voting_regressor'
13
13
  #
14
14
  # estimators = {
15
- # rdg: Rumale::LinearModel::Ridge.new(reg_param: 1e-2, random_seed: 1),
15
+ # rdg: Rumale::LinearModel::Ridge.new(reg_param: 0.1),
16
16
  # mlp: Rumale::NeuralNetwork::MLPRegressor.new(hidden_units: [256], random_seed: 1),
17
17
  # rnd: Rumale::Ensemble::RandomForestRegressor.new(random_seed: 1)
18
18
  # }
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.24.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: 2022-12-31 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.24.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.24.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.24.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.24.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.24.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.24.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.24.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.24.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.24.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.24.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,