def get_es_result(mode, current, best_so_far):
    """Returns true if monitored metric has been improved"""
    if mode == 'max':
        return current > best_so_far
    elif mode == 'min':
        return current < best_so_far