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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8534e936cb0e7decf0735addf29a849912c1a31aec2982aac7d35efc318f14d2
4
- data.tar.gz: d7b0fae01557b5b8161315bd9d4a11e3b84b48293a73e10ca53429e7f631533a
3
+ metadata.gz: 44ca952f1001f004bf80643f8b531fd89ff721111b4316d7e20154d13f92a0b3
4
+ data.tar.gz: c7cfb60f461d6708cabd88cee0eddcd0191566150e1ac258009fcbdec8a62b04
5
5
  SHA512:
6
- metadata.gz: ae84e94d8dea94c7acfebfd8023673a97775f9efdf436546b18a6d39c5d03018646ee1cc52e6223083381672766247b98724addd1f859579bef2b073fbab36d0
7
- data.tar.gz: f4f13ee11325b3e74f82ba41a13f87f51dca0c84e726c493f79862dd9c0e289122111780ff36ca4841bf61f504c11f4134002f766873d63aa6e99cf46fc71487
6
+ metadata.gz: d6e918ca9036b47ff06974c5397f52b2a65c8c7be1b3b5681b1192d2494ebec1c626928651db50a55d1f902301e334f2f5b5a0a19228e8f2e47ae167eef8fcef
7
+ data.tar.gz: c53af68293a66c41debf6f5a44627a0d364e000c184a7a94c45114fdd070b132cc0512328a7d194e112e49c7efb7d4937b60c4d39f367a935c2e02d2729355bd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.3.0 (2023-07-22)
2
+
3
+ - Updated LightGBM to 4.0.0
4
+ - Fixed error with `dup` and `clone`
5
+ - Dropped support for Ruby < 3
6
+
1
7
  ## 0.2.7 (2023-02-01)
2
8
 
3
9
  - Updated LightGBM to 3.3.5
@@ -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(self, self.class.finalize(handle_pointer))
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(pointer)
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
@@ -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(pointer)
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(self, self.class.finalize(handle_pointer)) unless used_indices
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
@@ -1,3 +1,3 @@
1
1
  module LightGBM
2
- VERSION = "0.2.7"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/lightgbm.rb CHANGED
@@ -2,16 +2,16 @@
2
2
  require "ffi"
3
3
 
4
4
  # modules
5
- require "lightgbm/utils"
6
- require "lightgbm/booster"
7
- require "lightgbm/dataset"
8
- require "lightgbm/version"
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
- require "lightgbm/model"
12
- require "lightgbm/classifier"
13
- require "lightgbm/ranker"
14
- require "lightgbm/regressor"
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 = [lib_name, "lib_lightgbm.so", vendor_lib]
29
+ self.ffi_lib = [vendor_lib]
30
30
 
31
31
  # friendlier error message
32
32
  autoload :FFI, "lightgbm/ffi"
@@ -1,5 +1,5 @@
1
1
  ================================================================================
2
- Boost.Compute 1.70.0
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 8ba1b0f41
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 7.1.2
469
+ fmt 8.1.1
470
470
  ================================================================================
471
471
 
472
472
  Copyright (c) 2012 - present, Victor Zverovich
Binary file
Binary file
Binary file
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.2.7
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-02-02 00:00:00.000000000 Z
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: '2.4'
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.1
71
+ rubygems_version: 3.4.10
72
72
  signing_key:
73
73
  specification_version: 4
74
74
  summary: High performance gradient boosting for Ruby