Sha256: 7829c65baa20070012e89ef4d2cb4de5a36e76bb9ae27d7c891137ca50a5c3e9

Contents?: true

Size: 689 Bytes

Versions: 19

Compression:

Stored size: 689 Bytes

Contents

module LightGBM
  class Ranker < Model
    def initialize(num_leaves: 31, learning_rate: 0.1, n_estimators: 100, objective: "lambdarank", **options)
      super
    end

    def fit(x, y, group:, categorical_feature: "auto", early_stopping_rounds: nil, verbose: true)
      train_set = Dataset.new(x, label: y, group: group, categorical_feature: categorical_feature)
      @booster = LightGBM.train(@params, train_set,
        num_boost_round: @n_estimators,
        early_stopping_rounds: early_stopping_rounds,
        verbose_eval: verbose
      )
      nil
    end

    def predict(data, num_iteration: nil)
      @booster.predict(data, num_iteration: num_iteration)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
lightgbm-0.3.4 lib/lightgbm/ranker.rb
lightgbm-0.3.3 lib/lightgbm/ranker.rb
lightgbm-0.3.2 lib/lightgbm/ranker.rb
lightgbm-0.3.1 lib/lightgbm/ranker.rb
lightgbm-0.3.0 lib/lightgbm/ranker.rb
lightgbm-0.2.7 lib/lightgbm/ranker.rb
lightgbm-0.2.6 lib/lightgbm/ranker.rb
lightgbm-0.2.5 lib/lightgbm/ranker.rb
lightgbm-0.2.4 lib/lightgbm/ranker.rb
lightgbm-0.2.3 lib/lightgbm/ranker.rb
lightgbm-0.2.2 lib/lightgbm/ranker.rb
lightgbm-0.2.1 lib/lightgbm/ranker.rb
lightgbm-0.2.0 lib/lightgbm/ranker.rb
lightgbm-0.1.9 lib/lightgbm/ranker.rb
lightgbm-0.1.8 lib/lightgbm/ranker.rb
lightgbm-0.1.7 lib/lightgbm/ranker.rb
lightgbm-0.1.6 lib/lightgbm/ranker.rb
lightgbm-0.1.5 lib/lightgbm/ranker.rb
lightgbm-0.1.4 lib/lightgbm/ranker.rb