def EI_empirical(samples, thresh):
    improvement = np.maximum(samples - thresh, 0)
    return improvement.mean()
Expected Improvement over threshold from samples
dataset/ETHPy150Open hyperopt/hyperopt/hyperopt/criteria.py/EI_empirical