#NEWLINE# def EI_empirical( samples , thresh ) : #NEWLINE# #INDENT# 'Expected Improvement over threshold from samples\n\n    (See example usage in EI_gaussian_empirical)\n    ' #NEWLINE# improvement = np . maximum ( ( samples - thresh ) , 0 ) #NEWLINE# return improvement . mean ( )