lightgbm 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/lightgbm/booster.rb +8 -3
- data/lib/lightgbm/dataset.rb +4 -5
- data/lib/lightgbm/ffi.rb +1 -1
- data/lib/lightgbm/version.rb +1 -1
- data/vendor/lib_lightgbm.dll +0 -0
- data/vendor/lib_lightgbm.dylib +0 -0
- data/vendor/lib_lightgbm.so +0 -0
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c609f529612c4aef7c34ecd59bb1b12df1d2b9bfb64ddae8e8a1eb4f5a8a2af
|
4
|
+
data.tar.gz: c0d1d48a5301dd66d5df8feee81e64140eb058dd1c38b1fccd8564b125d22aab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c2b002aa6e97a4d12de0076999c07be4077b6510f0b6a29cc6eb5d5f5ec23f2387ae52e82be0ab36ec2b00e27a93b337985ce1595de2845396ff9997c3172d5
|
7
|
+
data.tar.gz: ab3e47fb5c973576fc01632a0c1bf7479245f3037f61041c6c8596bd82ca2d37e1979474153e4a99302c5b276e98b7ed7772e0e00db21dcc90d4360bd775ed62
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/lightgbm/booster.rb
CHANGED
@@ -40,7 +40,7 @@ module LightGBM
|
|
40
40
|
out_len = ::FFI::MemoryPointer.new(:int64)
|
41
41
|
out_str = ::FFI::MemoryPointer.new(:string, buffer_len)
|
42
42
|
check_result FFI.LGBM_BoosterDumpModel(handle_pointer, start_iteration, num_iteration, buffer_len, out_len, out_str)
|
43
|
-
actual_len = out_len
|
43
|
+
actual_len = read_int64(out_len)
|
44
44
|
if actual_len > buffer_len
|
45
45
|
out_str = ::FFI::MemoryPointer.new(:string, actual_len)
|
46
46
|
check_result FFI.LGBM_BoosterDumpModel(handle_pointer, start_iteration, num_iteration, actual_len, out_len, out_str)
|
@@ -87,7 +87,7 @@ module LightGBM
|
|
87
87
|
out_len = ::FFI::MemoryPointer.new(:int64)
|
88
88
|
out_str = ::FFI::MemoryPointer.new(:string, buffer_len)
|
89
89
|
check_result FFI.LGBM_BoosterSaveModelToString(handle_pointer, start_iteration, num_iteration, buffer_len, out_len, out_str)
|
90
|
-
actual_len = out_len
|
90
|
+
actual_len = read_int64(out_len)
|
91
91
|
if actual_len > buffer_len
|
92
92
|
out_str = ::FFI::MemoryPointer.new(:string, actual_len)
|
93
93
|
check_result FFI.LGBM_BoosterSaveModelToString(handle_pointer, start_iteration, num_iteration, actual_len, out_len, out_str)
|
@@ -137,7 +137,7 @@ module LightGBM
|
|
137
137
|
out_len = ::FFI::MemoryPointer.new(:int64)
|
138
138
|
out_result = ::FFI::MemoryPointer.new(:double, num_class * input.count)
|
139
139
|
check_result FFI.LGBM_BoosterPredictForMat(handle_pointer, data, 0, input.count, input.first.count, 1, 0, num_iteration, params_str(params), out_len, out_result)
|
140
|
-
out = out_result.read_array_of_double(out_len
|
140
|
+
out = out_result.read_array_of_double(read_int64(out_len))
|
141
141
|
out = out.each_slice(num_class).to_a if num_class > 1
|
142
142
|
|
143
143
|
singular ? out.first : out
|
@@ -202,6 +202,11 @@ module LightGBM
|
|
202
202
|
out.read_int
|
203
203
|
end
|
204
204
|
|
205
|
+
# read_int64 not available on JRuby
|
206
|
+
def read_int64(ptr)
|
207
|
+
ptr.read_array_of_int64(1).first
|
208
|
+
end
|
209
|
+
|
205
210
|
include Utils
|
206
211
|
end
|
207
212
|
end
|
data/lib/lightgbm/dataset.rb
CHANGED
@@ -103,11 +103,6 @@ module LightGBM
|
|
103
103
|
check_result FFI.LGBM_DatasetSaveBinary(handle_pointer, filename)
|
104
104
|
end
|
105
105
|
|
106
|
-
# not released yet
|
107
|
-
# def dump_text(filename)
|
108
|
-
# check_result FFI.LGBM_DatasetDumpText(handle_pointer, filename)
|
109
|
-
# end
|
110
|
-
|
111
106
|
def subset(used_indices, params: nil)
|
112
107
|
# categorical_feature passed via params
|
113
108
|
params ||= self.params
|
@@ -129,6 +124,10 @@ module LightGBM
|
|
129
124
|
|
130
125
|
private
|
131
126
|
|
127
|
+
def dump_text(filename)
|
128
|
+
check_result FFI.LGBM_DatasetDumpText(handle_pointer, filename)
|
129
|
+
end
|
130
|
+
|
132
131
|
def field(field_name)
|
133
132
|
num_data = self.num_data
|
134
133
|
out_len = ::FFI::MemoryPointer.new(:int)
|
data/lib/lightgbm/ffi.rb
CHANGED
@@ -26,7 +26,7 @@ module LightGBM
|
|
26
26
|
attach_function :LGBM_DatasetGetFeatureNames, %i[pointer pointer pointer], :int
|
27
27
|
attach_function :LGBM_DatasetFree, %i[pointer], :int
|
28
28
|
attach_function :LGBM_DatasetSaveBinary, %i[pointer string], :int
|
29
|
-
|
29
|
+
attach_function :LGBM_DatasetDumpText, %i[pointer string], :int
|
30
30
|
attach_function :LGBM_DatasetSetField, %i[pointer string pointer int int], :int
|
31
31
|
attach_function :LGBM_DatasetGetField, %i[pointer string pointer pointer pointer], :int
|
32
32
|
attach_function :LGBM_DatasetGetNumData, %i[pointer pointer], :int
|
data/lib/lightgbm/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: numo-narray
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
83
|
description:
|
98
84
|
email: andrew@chartkick.com
|
99
85
|
executables: []
|