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 +4 -4
- data/CHANGELOG.md +4 -0
- data/NOTICE.txt +2 -2
- data/README.md +2 -1
- data/lib/xgboost/booster.rb +5 -0
- data/lib/xgboost/classifier.rb +1 -1
- data/lib/xgboost/ffi.rb +1 -0
- data/lib/xgboost/model.rb +2 -1
- data/lib/xgboost/regressor.rb +1 -1
- data/lib/xgboost/version.rb +1 -1
- data/lib/xgboost.rb +1 -1
- data/vendor/aarch64-linux/libxgboost.so +0 -0
- data/vendor/arm64-darwin/libxgboost.dylib +0 -0
- data/vendor/x64-mingw/xgboost.dll +0 -0
- data/vendor/x86_64-darwin/libxgboost.dylib +0 -0
- data/vendor/x86_64-linux/libxgboost.so +0 -0
- data/vendor/x86_64-linux-musl/libxgboost.so +0 -0
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c717478c585e099431318c391c7c054b58c844f5ddb19dd5d23f921acbea5b26
|
4
|
+
data.tar.gz: dd221a13627c57135ef2e6e87f267889a76692f1417014e5728b5c279b44a2d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4430473a5999cde2447f0782be837f1fb06db44eb3e823621ae94db96b356b40e04a772fa211819ed5915324a10b54ccb0b595d7368aaa22d31f6be4eb13fd0d
|
7
|
+
data.tar.gz: eccc8f38705f82f2aa963c672df5515aa345926af91f9f94beab5fd01406a8d5ad84807d3609dec321952d28d8b2da575b880220ae8375d4296a2c34bf6b0b97
|
data/CHANGELOG.md
CHANGED
data/NOTICE.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
Copyright XGBoost contributors
|
2
|
-
Copyright 2019-
|
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.
|
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
|
data/lib/xgboost/booster.rb
CHANGED
@@ -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)
|
data/lib/xgboost/classifier.rb
CHANGED
@@ -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)
|
data/lib/xgboost/regressor.rb
CHANGED
@@ -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
|
)
|
data/lib/xgboost/version.rb
CHANGED
data/lib/xgboost.rb
CHANGED
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.
|
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:
|
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.
|
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: []
|