#NEWLINE# def __call__( self , y , proba , sample_weight ) : #NEWLINE# #INDENT# y_pred = proba [ ( self . _mask , self . uniform_label ) ] #NEWLINE# if ( self . target_rcp is None ) : #NEWLINE# #INDENT# self . target_rcp = [ 0.5 , 0.6 , 0.7 , 0.8 , 0.9 ] #NEWLINE# #UNINDENT# result = 0.0 #NEWLINE# cuts = weighted_percentile ( y_pred , self . target_rcp , sample_weight = self . _masked_weight ) #NEWLINE# for cut in cuts : #NEWLINE# #INDENT# bin_efficiencies = ut . compute_bin_efficiencies ( y_pred , bin_indices = self . _bin_indices , cut = cut , sample_weight = self . _masked_weight ) #NEWLINE# result += ut . weighted_deviation ( bin_efficiencies , weights = self . _bin_weights , power = proba . power ) #NEWLINE# #UNINDENT# return ( ( result / len ( cuts ) ) ** ( 1.0 / self . power ) )