#NEWLINE# def theil_flatness( y , proba , X , uniform_variables , sample_weight = None , label = 1 , knn = 30 ) : #NEWLINE# #INDENT# 'This is ready-to-use function, and it is quite slow to use many times' #NEWLINE# sample_weight = check_sample_weight ( y , sample_weight = sample_weight ) #NEWLINE# mask = ( y == label ) #NEWLINE# groups_indices = computeSignalKnnIndices ( uniform_variables , X , is_signal = mask , n_neighbors = knn ) [ mask , : ] #NEWLINE# return ut . compute_theil_on_groups ( proba [ : , label ] , mask = mask , groups_indices = groups_indices , target_efficiencies = [ 0.5 , 0.6 , 0.7 , 0.8 , 0.9 ] , sample_weight = sample_weight )