Sha256: b31738350d9bc89fc741d7bbaca338ab7eaa25fff1c9854d64c8929e8420ed03

Contents?: true

Size: 387 Bytes

Versions: 2

Compression:

Stored size: 387 Bytes

Contents

module Xgb
  class Ranker < Model
    def initialize(max_depth: 3, learning_rate: 0.1, n_estimators: 100, objective: "rank:pairwise", importance_type: "gain", **options)
      super
    end

    def fit(x, y, group)
      dtrain = DMatrix.new(x, label: y)
      dtrain.group = group
      @booster = Xgb.train(@params, dtrain, num_boost_round: @n_estimators)
      nil
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xgb-0.1.3 lib/xgb/ranker.rb
xgb-0.1.2 lib/xgb/ranker.rb