fixed error when eval False (#1271)

This commit is contained in:
Vladimir 2016-06-12 18:36:36 +02:00 committed by Tianqi Chen
parent 7cfeb5f012
commit aaf0a73486

View File

@ -38,7 +38,7 @@ def print_evaluation(period=1, show_stdv=True):
"""
def callback(env):
"""internal function"""
if env.rank != 0 or len(env.evaluation_result_list) == 0:
if env.rank != 0 or len(env.evaluation_result_list) == 0 or period is False:
return
i = env.iteration
if (i % period == 0 or i + 1 == env.begin_iteration):