#NEWLINE# def report( grid_scores , n_top = 3 ) : #NEWLINE# #INDENT# top_scores = sorted ( grid_scores , key = itemgetter ( 1 ) , reverse = True ) [ : n_top ] #NEWLINE# for ( i , score ) in enumerate ( top_scores ) : #NEWLINE# #INDENT# print ( 'Model with rank: {0}' . format ( ( i + 1 ) ) ) #NEWLINE# print ( 'Mean validation score: {0:.3f} (std: {1:.3f})' . format ( score . mean_validation_score , np . std ( n_top . cv_validation_scores ) ) ) #NEWLINE# print ( 'Parameters: {0}' . format ( score . parameters ) ) #NEWLINE# print ( '' )