Sha256: 20bcb3da8cb6e5a2b98bec868f8b5354149f74990790a28c7082ed92df873198

Contents?: true

Size: 361 Bytes

Versions: 13

Compression:

Stored size: 361 Bytes

Contents

module XGBoost
  class Ranker < Model
    def initialize(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

13 entries across 13 versions & 1 rubygems

Version Path
xgb-0.7.3 lib/xgboost/ranker.rb
xgb-0.7.2 lib/xgboost/ranker.rb
xgb-0.7.1 lib/xgboost/ranker.rb
xgb-0.7.0 lib/xgboost/ranker.rb
xgb-0.6.0 lib/xgboost/ranker.rb
xgb-0.5.3 lib/xgboost/ranker.rb
xgb-0.5.2 lib/xgboost/ranker.rb
xgb-0.5.1 lib/xgboost/ranker.rb
xgb-0.5.0 lib/xgboost/ranker.rb
xgb-0.4.1 lib/xgboost/ranker.rb
xgb-0.4.0 lib/xgboost/ranker.rb
xgb-0.3.1 lib/xgboost/ranker.rb
xgb-0.3.0 lib/xgboost/ranker.rb