xgb 0.9.0 → 0.10.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: ba232bc8a9c27bc9cfb2b7f87afc581acf9a5464df9fccf1b206d912704771fe
4
- data.tar.gz: 608ca80f01e81d32a31b796364de14096c89556543fa2892efd86bbf86fac96a
3
+ metadata.gz: c717478c585e099431318c391c7c054b58c844f5ddb19dd5d23f921acbea5b26
4
+ data.tar.gz: dd221a13627c57135ef2e6e87f267889a76692f1417014e5728b5c279b44a2d5
5
5
  SHA512:
6
- metadata.gz: af38ca270cf3d12a8a7757ff5f32a41f5d68e43f9ad08c585df8efae835d014ddcac51201019aa339143cc081c5c69ef5914d8de06cb4326ccb2864b5b04eba2
7
- data.tar.gz: 787bddc1c867d648ffe13c783aede98c62917feca536d1f8fe27e7992e5f2945126ad15b1a4e3ff48cc041723d299cf3cbacdd5557083983575eae22a9583cd8
6
+ metadata.gz: 4430473a5999cde2447f0782be837f1fb06db44eb3e823621ae94db96b356b40e04a772fa211819ed5915324a10b54ccb0b595d7368aaa22d31f6be4eb13fd0d
7
+ data.tar.gz: eccc8f38705f82f2aa963c672df5515aa345926af91f9f94beab5fd01406a8d5ad84807d3609dec321952d28d8b2da575b880220ae8375d4296a2c34bf6b0b97
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.10.0 (2025-03-15)
2
+
3
+ - Updated XGBoost to 3.0.0
4
+
1
5
  ## 0.9.0 (2024-10-17)
2
6
 
3
7
  - Updated XGBoost to 2.1.1
data/NOTICE.txt CHANGED
@@ -1,5 +1,5 @@
1
- Copyright XGBoost contributors
2
- Copyright 2019-2024 Andrew Kane
1
+ Copyright 2014-2025 XGBoost contributors
2
+ Copyright 2019-2025 Andrew Kane
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -126,7 +126,8 @@ model.feature_importances
126
126
  Early stopping
127
127
 
128
128
  ```ruby
129
- model.fit(x, y, eval_set: [[x_test, y_test]], early_stopping_rounds: 5)
129
+ model = XGBoost::Regressor.new(early_stopping_rounds: 5)
130
+ model.fit(x, y, eval_set: [[x_test, y_test]])
130
131
  ```
131
132
 
132
133
  ## Data
@@ -47,6 +47,11 @@ module XGBoost
47
47
  json_string.read_pointer.read_string(length.read_uint64).force_encoding(Encoding::UTF_8)
48
48
  end
49
49
 
50
+ def reset
51
+ check_call FFI.XGBoosterReset(handle)
52
+ self
53
+ end
54
+
50
55
  def attr(key)
51
56
  ret = ::FFI::MemoryPointer.new(:pointer)
52
57
  success = ::FFI::MemoryPointer.new(:int)
@@ -18,7 +18,7 @@ module XGBoost
18
18
 
19
19
  @booster = XGBoost.train(params, dtrain,
20
20
  num_boost_round: @n_estimators,
21
- early_stopping_rounds: early_stopping_rounds,
21
+ early_stopping_rounds: early_stopping_rounds || @early_stopping_rounds,
22
22
  verbose_eval: verbose,
23
23
  evals: evals
24
24
  )
data/lib/xgboost/ffi.rb CHANGED
@@ -39,6 +39,7 @@ module XGBoost
39
39
  attach_function :XGBoosterUpdateOneIter, %i[pointer int pointer], :int
40
40
  attach_function :XGBoosterEvalOneIter, %i[pointer int pointer pointer uint64 pointer], :int
41
41
  attach_function :XGBoosterFree, %i[pointer], :int
42
+ attach_function :XGBoosterReset, %i[pointer], :int
42
43
  attach_function :XGBoosterBoostedRounds, %i[pointer pointer], :int
43
44
  attach_function :XGBoosterSetParam, %i[pointer string string], :int
44
45
  attach_function :XGBoosterGetNumFeature, %i[pointer pointer], :int
data/lib/xgboost/model.rb CHANGED
@@ -2,10 +2,11 @@ module XGBoost
2
2
  class Model
3
3
  attr_reader :booster
4
4
 
5
- def initialize(n_estimators: 100, importance_type: "gain", **options)
5
+ def initialize(n_estimators: 100, importance_type: "gain", early_stopping_rounds: nil, **options)
6
6
  @params = options
7
7
  @n_estimators = n_estimators
8
8
  @importance_type = importance_type
9
+ @early_stopping_rounds = early_stopping_rounds
9
10
  end
10
11
 
11
12
  def predict(data)
@@ -10,7 +10,7 @@ module XGBoost
10
10
 
11
11
  @booster = XGBoost.train(@params, dtrain,
12
12
  num_boost_round: @n_estimators,
13
- early_stopping_rounds: early_stopping_rounds,
13
+ early_stopping_rounds: early_stopping_rounds || @early_stopping_rounds,
14
14
  verbose_eval: verbose,
15
15
  evals: evals
16
16
  )
@@ -1,3 +1,3 @@
1
1
  module XGBoost
2
- VERSION = "0.9.0"
2
+ VERSION = "0.10.0"
3
3
  end
data/lib/xgboost.rb CHANGED
@@ -91,7 +91,7 @@ module XGBoost
91
91
  evals_result.merge!(cb_container.history)
92
92
  end
93
93
 
94
- bst
94
+ bst.reset
95
95
  end
96
96
 
97
97
  def cv(
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xgb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-10-17 00:00:00.000000000 Z
10
+ date: 2025-03-15 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: ffi
@@ -24,7 +23,6 @@ dependencies:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
27
- description:
28
26
  email: andrew@ankane.org
29
27
  executables: []
30
28
  extensions: []
@@ -73,7 +71,6 @@ homepage: https://github.com/ankane/xgboost-ruby
73
71
  licenses:
74
72
  - Apache-2.0
75
73
  metadata: {}
76
- post_install_message:
77
74
  rdoc_options: []
78
75
  require_paths:
79
76
  - lib
@@ -88,8 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
85
  - !ruby/object:Gem::Version
89
86
  version: '0'
90
87
  requirements: []
91
- rubygems_version: 3.5.16
92
- signing_key:
88
+ rubygems_version: 3.6.2
93
89
  specification_version: 4
94
90
  summary: High performance gradient boosting for Ruby
95
91
  test_files: []