Sha256: 41196207d16d378a6ba2b4ae5a4b8f8086c64d08ad5e70fc6baad6468c51bfff

Contents?: true

Size: 395 Bytes

Versions: 2

Compression:

Stored size: 395 Bytes

Contents

module XGBoost
  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 = XGBoost.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.2.1 lib/xgboost/ranker.rb
xgb-0.2.0 lib/xgboost/ranker.rb