Commit 595c10ab authored by Guolin Ke's avatar Guolin Ke
Browse files

some naming fix

parent 27624755
......@@ -898,9 +898,10 @@ class Booster(object):
if 'metric' in params:
self.__need_reload_eval_info = True
params_str = param_dict_to_str(params)
_safe_call(_LIB.LGBM_BoosterResetParameter(
self.handle,
c_str(params_str)))
if params_str:
_safe_call(_LIB.LGBM_BoosterResetParameter(
self.handle,
c_str(params_str)))
def update(self, train_set=None, fobj=None):
"""
......
......@@ -166,7 +166,7 @@ def train(params, train_data, num_boost_round=100,
"""start training"""
for i in range(num_boost_round):
for cb in callbacks_before_iter:
cb(CallbackEnv(model=booster,
cb(callback.CallbackEnv(model=booster,
cvfolds=None,
iteration=i,
begin_iteration=0,
......@@ -183,16 +183,16 @@ def train(params, train_data, num_boost_round=100,
evaluation_result_list.extend(booster.eval_valid(feval))
try:
for cb in callbacks_after_iter:
cb(CallbackEnv(model=booster,
cb(callback.CallbackEnv(model=booster,
cvfolds=None,
iteration=i,
begin_iteration=0,
end_iteration=num_boost_round,
evaluation_result_list=evaluation_result_list))
except EarlyStopException:
except callback.EarlyStopException:
break
if booster.attr('best_iteration') is not None:
booster.best_iteration = int(booster.attr('best_iteration'))
else:
booster.best_iteration = num_boost_round - 1
return num_boost_round
\ No newline at end of file
return num_boost_round
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment