Class: XGBoost::CVPack

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/xgboost/cv_pack.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dtrain, dtest, param) ⇒ CVPack

Returns a new instance of CVPack.



11
12
13
14
15
16
# File 'lib/xgboost/cv_pack.rb', line 11

def initialize(dtrain, dtest, param)
  @dtrain = dtrain
  @dtest = dtest
  @watchlist = [[dtrain, "train"], [dtest, "test"]]
  @bst = Booster.new(params: param, cache: [dtrain, dtest])
end

Instance Attribute Details

#bstObject (readonly)

Returns the value of attribute bst.



9
10
11
# File 'lib/xgboost/cv_pack.rb', line 9

def bst
  @bst
end

Instance Method Details

#eval_set(iteration) ⇒ Object



22
23
24
# File 'lib/xgboost/cv_pack.rb', line 22

def eval_set(iteration)
  @bst.eval_set(@watchlist, iteration)
end

#update(iteration) ⇒ Object



18
19
20
# File 'lib/xgboost/cv_pack.rb', line 18

def update(iteration)
  @bst.update(@dtrain, iteration)
end