Class: XGBoost::CVPack
- Inherits:
-
Object
- Object
- XGBoost::CVPack
- Extended by:
- Forwardable
- Defined in:
- lib/xgboost/cv_pack.rb
Instance Attribute Summary collapse
-
#bst ⇒ Object
readonly
Returns the value of attribute bst.
Instance Method Summary collapse
- #eval_set(iteration) ⇒ Object
-
#initialize(dtrain, dtest, param) ⇒ CVPack
constructor
A new instance of CVPack.
- #update(iteration) ⇒ Object
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
#bst ⇒ Object (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 |