lightgbm 0.1.8 → 0.1.9

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: d3b86686bc4575d069e469fb9c8911e93c7dcfb7622a415dc3e7ebee301947c3
4
- data.tar.gz: a186cca11d4838fd13573b14ea154fff174804b31ae45236130c30a24f55ff7b
3
+ metadata.gz: a4aac9eac1ab0dadbf31d1e1fc2714e75a8c37075538aef5c53b42df1c34f658
4
+ data.tar.gz: ca3a1043c55184992b3fac611963062d01747449f6170719ef1f299d4f0474c9
5
5
  SHA512:
6
- metadata.gz: 32ef8f452075bcf4441b8e0fcf68e63332c42da61445301ecd0a85b51b2af1b7a730da0810e1b182ff5fdfe184884242a5489469d16e0e9a717d19bb145eb095
7
- data.tar.gz: 41b76c5ac174b75ce4e4f21477e4d32a9607b550e70448dde2797a765813d08a6c75de2f7f6d04ea79b4e9fa8afd768d097be516781e27e4eee4f982af364dc0
6
+ metadata.gz: c2f14ccc3b40690060d2ee533cfe46e137f40e91520aab3eb188a8a03a697a6956853b717e743cd357d0a059836fc32e9e0aa0fbe5a7dd4263b1ff3e94e79601
7
+ data.tar.gz: 64abdb43f4c45222dcbb39ddde1d21350b2b4958439dc84d8f13684f4e9bcd3aa2c0e49aa8fd9ae1dfc09b8bc0ce69592e95aab0542684f3c952e9e67ac4689f
@@ -1,3 +1,8 @@
1
+ ## 0.1.9 (2020-06-10)
2
+
3
+ - Added support for Rover
4
+ - Improved performance of Numo datasets
5
+
1
6
  ## 0.1.8 (2020-05-09)
2
7
 
3
8
  - Improved error message when OpenMP not found on Mac
data/README.md CHANGED
@@ -129,16 +129,22 @@ Data can be an array of arrays
129
129
  [[1, 2, 3], [4, 5, 6]]
130
130
  ```
131
131
 
132
- Or a Daru data frame
132
+ Or a Numo NArray
133
133
 
134
134
  ```ruby
135
- Daru::DataFrame.from_csv("houses.csv")
135
+ Numo::NArray.cast([[1, 2, 3], [4, 5, 6]])
136
136
  ```
137
137
 
138
- Or a Numo NArray
138
+ Or a Rover data frame
139
+
140
+ ```ruby
141
+ Rover.read_csv("houses.csv")
142
+ ```
143
+
144
+ Or a Daru data frame
139
145
 
140
146
  ```ruby
141
- Numo::DFloat.new(3, 2).seq
147
+ Daru::DataFrame.from_csv("houses.csv")
142
148
  ```
143
149
 
144
150
  ## Helpful Resources
@@ -130,18 +130,23 @@ module LightGBM
130
130
  elsif daru?(data)
131
131
  nrow, ncol = data.shape
132
132
  flat_data = data.map_rows(&:to_a).flatten
133
- elsif narray?(data)
133
+ elsif numo?(data) || rover?(data)
134
+ data = data.to_numo if rover?(data)
134
135
  nrow, ncol = data.shape
135
- flat_data = data.flatten.to_a
136
136
  else
137
137
  nrow = data.count
138
138
  ncol = data.first.count
139
139
  flat_data = data.flatten
140
140
  end
141
141
 
142
- handle_missing(flat_data)
143
142
  c_data = ::FFI::MemoryPointer.new(:double, nrow * ncol)
144
- c_data.write_array_of_double(flat_data)
143
+ if numo?(data)
144
+ c_data.write_bytes(data.cast_to(Numo::DFloat).to_string)
145
+ else
146
+ handle_missing(flat_data)
147
+ c_data.write_array_of_double(flat_data)
148
+ end
149
+
145
150
  check_result FFI.LGBM_DatasetCreateFromMat(c_data, 1, nrow, ncol, 1, parameters, reference, @handle)
146
151
  end
147
152
  ObjectSpace.define_finalizer(self, self.class.finalize(handle_pointer)) unless used_indices
@@ -37,8 +37,12 @@ module LightGBM
37
37
  defined?(Daru::DataFrame) && data.is_a?(Daru::DataFrame)
38
38
  end
39
39
 
40
- def narray?(data)
40
+ def numo?(data)
41
41
  defined?(Numo::NArray) && data.is_a?(Numo::NArray)
42
42
  end
43
+
44
+ def rover?(data)
45
+ defined?(Rover::DataFrame) && data.is_a?(Rover::DataFrame)
46
+ end
43
47
  end
44
48
  end
@@ -1,3 +1,3 @@
1
1
  module LightGBM
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
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.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-09 00:00:00.000000000 Z
11
+ date: 2020-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi