def EI_empirical(samples, thresh):
 improvement = np.maximum((samples - thresh), 0)
 return improvement.mean()

def EI_empirical ( samples , thresh ) : improvement = np . maximum ( ( samples - thresh ) , 0 ) return improvement . mean ( )
expected improvement over threshold from samples .