lib/lightgbm.rb in lightgbm-0.1.3 vs lib/lightgbm.rb in lightgbm-0.1.4

- old
+ new

@@ -3,18 +3,28 @@ # modules require "lightgbm/utils" require "lightgbm/booster" require "lightgbm/dataset" -require "lightgbm/ffi" require "lightgbm/version" # scikit-learn API +require "lightgbm/model" require "lightgbm/classifier" +require "lightgbm/ranker" require "lightgbm/regressor" module LightGBM class Error < StandardError; end + + class << self + attr_accessor :ffi_lib + end + lib_name = "lib_lightgbm.#{::FFI::Platform::LIBSUFFIX}" + self.ffi_lib = [lib_name, "lib_lightgbm.so"] + + # friendlier error message + autoload :FFI, "lightgbm/ffi" class << self def train(params, train_set, num_boost_round: 100, valid_sets: [], valid_names: [], early_stopping_rounds: nil, verbose_eval: true) booster = Booster.new(params: params, train_set: train_set)