#NEWLINE# def efficiency_score( y_true , y_pred , sample_weight = None ) : #NEWLINE# #INDENT# 'Efficiency = right classified signal / everything that is really signal\n    Efficiency == recall, returns -0.1 when ill-defined' #NEWLINE# sample_weight = check_sample_weight ( y_true , sample_weight = sample_weight ) #NEWLINE# assert ( len ( y_pred ) == len ( y_pred ) ) , 'Different size of arrays' #NEWLINE# isSignal = ( numpy . sum ( ( y_true * sample_weight ) ) - 1e-06 ) #NEWLINE# isSignalAsSignal = ( numpy . sum ( ( ( y_true * y_pred ) * sample_weight ) ) + 1e-07 ) #NEWLINE# return ( isSignalAsSignal / isSignal )