Class: XGBoost::Ranker
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #fit(x, y, group) ⇒ Object
-
#initialize(objective: "rank:ndcg", **options) ⇒ Ranker
constructor
A new instance of Ranker.
Methods inherited from Model
#feature_importances, #load_model, #predict, #save_model
Constructor Details
#initialize(objective: "rank:ndcg", **options) ⇒ Ranker
Returns a new instance of Ranker.
3 4 5 |
# File 'lib/xgboost/ranker.rb', line 3 def initialize(objective: "rank:ndcg", **) super end |
Instance Method Details
#fit(x, y, group) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/xgboost/ranker.rb', line 7 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 |