lightgbm 0.2.7 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/lightgbm/booster.rb +3 -3
- data/lib/lightgbm/dataset.rb +3 -9
- data/lib/lightgbm/version.rb +1 -1
- data/lib/lightgbm.rb +9 -9
- data/vendor/LICENSE-THIRD-PARTY +3 -3
- data/vendor/lib_lightgbm.arm64.dylib +0 -0
- data/vendor/lib_lightgbm.dll +0 -0
- data/vendor/lib_lightgbm.dylib +0 -0
- data/vendor/lib_lightgbm.so +0 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44ca952f1001f004bf80643f8b531fd89ff721111b4316d7e20154d13f92a0b3
|
4
|
+
data.tar.gz: c7cfb60f461d6708cabd88cee0eddcd0191566150e1ac258009fcbdec8a62b04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6e918ca9036b47ff06974c5397f52b2a65c8c7be1b3b5681b1192d2494ebec1c626928651db50a55d1f902301e334f2f5b5a0a19228e8f2e47ae167eef8fcef
|
7
|
+
data.tar.gz: c53af68293a66c41debf6f5a44627a0d364e000c184a7a94c45114fdd070b132cc0512328a7d194e112e49c7efb7d4937b60c4d39f367a935c2e02d2729355bd
|
data/CHANGELOG.md
CHANGED
data/lib/lightgbm/booster.rb
CHANGED
@@ -14,7 +14,7 @@ module LightGBM
|
|
14
14
|
set_verbosity(params)
|
15
15
|
check_result FFI.LGBM_BoosterCreate(train_set.handle_pointer, params_str(params), @handle)
|
16
16
|
end
|
17
|
-
ObjectSpace.define_finalizer(
|
17
|
+
ObjectSpace.define_finalizer(@handle, self.class.finalize(handle_pointer.to_i))
|
18
18
|
|
19
19
|
self.best_iteration = -1
|
20
20
|
|
@@ -179,9 +179,9 @@ module LightGBM
|
|
179
179
|
finished.read_int == 1
|
180
180
|
end
|
181
181
|
|
182
|
-
def self.finalize(
|
182
|
+
def self.finalize(addr)
|
183
183
|
# must use proc instead of stabby lambda
|
184
|
-
proc { FFI.LGBM_BoosterFree(pointer) }
|
184
|
+
proc { FFI.LGBM_BoosterFree(::FFI::Pointer.new(:pointer, addr)) }
|
185
185
|
end
|
186
186
|
|
187
187
|
private
|
data/lib/lightgbm/dataset.rb
CHANGED
@@ -75,7 +75,6 @@ module LightGBM
|
|
75
75
|
def reference=(reference)
|
76
76
|
if reference != @reference
|
77
77
|
@reference = reference
|
78
|
-
free_handle
|
79
78
|
construct
|
80
79
|
end
|
81
80
|
end
|
@@ -110,9 +109,9 @@ module LightGBM
|
|
110
109
|
@handle.read_pointer
|
111
110
|
end
|
112
111
|
|
113
|
-
def self.finalize(
|
112
|
+
def self.finalize(addr)
|
114
113
|
# must use proc instead of stabby lambda
|
115
|
-
proc { FFI.LGBM_DatasetFree(pointer) }
|
114
|
+
proc { FFI.LGBM_DatasetFree(::FFI::Pointer.new(:pointer, addr)) }
|
116
115
|
end
|
117
116
|
|
118
117
|
private
|
@@ -164,7 +163,7 @@ module LightGBM
|
|
164
163
|
|
165
164
|
check_result FFI.LGBM_DatasetCreateFromMat(c_data, 1, nrow, ncol, 1, parameters, reference, @handle)
|
166
165
|
end
|
167
|
-
ObjectSpace.define_finalizer(
|
166
|
+
ObjectSpace.define_finalizer(@handle, self.class.finalize(handle_pointer.to_i)) unless used_indices
|
168
167
|
|
169
168
|
self.label = @label if @label
|
170
169
|
self.weight = @weight if @weight
|
@@ -172,11 +171,6 @@ module LightGBM
|
|
172
171
|
self.feature_names = @feature_names if @feature_names
|
173
172
|
end
|
174
173
|
|
175
|
-
def free_handle
|
176
|
-
FFI.LGBM_DatasetFree(handle_pointer)
|
177
|
-
ObjectSpace.undefine_finalizer(self)
|
178
|
-
end
|
179
|
-
|
180
174
|
def dump_text(filename)
|
181
175
|
check_result FFI.LGBM_DatasetDumpText(handle_pointer, filename)
|
182
176
|
end
|
data/lib/lightgbm/version.rb
CHANGED
data/lib/lightgbm.rb
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
require "ffi"
|
3
3
|
|
4
4
|
# modules
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
require_relative "lightgbm/utils"
|
6
|
+
require_relative "lightgbm/booster"
|
7
|
+
require_relative "lightgbm/dataset"
|
8
|
+
require_relative "lightgbm/version"
|
9
9
|
|
10
10
|
# scikit-learn API
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
require_relative "lightgbm/model"
|
12
|
+
require_relative "lightgbm/classifier"
|
13
|
+
require_relative "lightgbm/ranker"
|
14
|
+
require_relative "lightgbm/regressor"
|
15
15
|
|
16
16
|
module LightGBM
|
17
17
|
class Error < StandardError; end
|
@@ -26,7 +26,7 @@ module LightGBM
|
|
26
26
|
"lib_lightgbm.#{::FFI::Platform::LIBSUFFIX}"
|
27
27
|
end
|
28
28
|
vendor_lib = File.expand_path("../vendor/#{lib_name}", __dir__)
|
29
|
-
self.ffi_lib = [
|
29
|
+
self.ffi_lib = [vendor_lib]
|
30
30
|
|
31
31
|
# friendlier error message
|
32
32
|
autoload :FFI, "lightgbm/ffi"
|
data/vendor/LICENSE-THIRD-PARTY
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
================================================================================
|
2
|
-
Boost.Compute 1.
|
2
|
+
Boost.Compute 1.78.0
|
3
3
|
================================================================================
|
4
4
|
|
5
5
|
Boost Software License - Version 1.0 - August 17th, 2003
|
@@ -27,7 +27,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
27
27
|
DEALINGS IN THE SOFTWARE.
|
28
28
|
|
29
29
|
================================================================================
|
30
|
-
Eigen
|
30
|
+
Eigen 3.4.0
|
31
31
|
================================================================================
|
32
32
|
|
33
33
|
Source code available at https://gitlab.com/libeigen/eigen
|
@@ -466,7 +466,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
466
466
|
DEALINGS IN THE SOFTWARE.
|
467
467
|
|
468
468
|
================================================================================
|
469
|
-
fmt
|
469
|
+
fmt 8.1.1
|
470
470
|
================================================================================
|
471
471
|
|
472
472
|
Copyright (c) 2012 - present, Victor Zverovich
|
Binary file
|
data/vendor/lib_lightgbm.dll
CHANGED
Binary file
|
data/vendor/lib_lightgbm.dylib
CHANGED
Binary file
|
data/vendor/lib_lightgbm.so
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lightgbm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -61,14 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
61
61
|
requirements:
|
62
62
|
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: '
|
64
|
+
version: '3'
|
65
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
requirements: []
|
71
|
-
rubygems_version: 3.4.
|
71
|
+
rubygems_version: 3.4.10
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
74
|
summary: High performance gradient boosting for Ruby
|