From d3bfc31e6a45bf36fdf44547b90b0787eaa398e5 Mon Sep 17 00:00:00 2001 From: tqchen Date: Mon, 18 Aug 2014 09:00:23 -0700 Subject: [PATCH] enforce putting iteration numbers in train --- python/xgboost.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/xgboost.py b/python/xgboost.py index 6ea1cd921..6296d6263 100644 --- a/python/xgboost.py +++ b/python/xgboost.py @@ -134,8 +134,12 @@ class Booster: xglib.XGBoosterSetParam( self.handle, ctypes.c_char_p(k.encode('utf-8')), ctypes.c_char_p(str(v).encode('utf-8'))) - def update(self, dtrain, it=1): - """ update """ + def update(self, dtrain, it): + """ + update + dtrain: the training DMatrix + it: current iteration number + """ assert isinstance(dtrain, DMatrix) xglib.XGBoosterUpdateOneIter(self.handle, it, dtrain.handle) def boost(self, dtrain, grad, hess):