def test_classification_report_imbalanced_multiclass_with_long_string_label():
 (y_true, y_pred, _) = make_prediction(binary=False)
 labels = np.array(['blue', ('green' * 5), 'red'])
 y_true = labels[y_true]
 y_pred = labels[y_pred]
 expected_report = 'pre rec spe f1 geo iba sup blue 0.83 0.79 0.92 0.81 0.86 0.74 24 greengreengreengreengreen 0.33 0.10 0.86 0.15 0.44 0.19 31 red 0.42 0.90 0.55 0.57 0.63 0.37 20 avg / total 0.51 0.53 0.80 0.47 0.62 0.41 75'
 report = classification_report_imbalanced(y_true, y_pred)
 assert_equal(_format_report(report), expected_report)

def test_classification_report_imbalanced_multiclass_with_long_string_label ( ) : ( y_true , y_pred , _ ) = make_prediction ( binary = False ) labels = np . array ( [ 'blue' , ( 'green' * 5 ) , 'red' ] ) y_true = labels [ y_true ] y_pred = labels [ y_pred ] expected_report = 'pre rec spe f1 geo iba sup blue 0.83 0.79 0.92 0.81 0.86 0.74 24 greengreengreengreengreen 0.33 0.10 0.86 0.15 0.44 0.19 31 red 0.42 0.90 0.55 0.57 0.63 0.37 20 avg / total 0.51 0.53 0.80 0.47 0.62 0.41 75' report = classification_report_imbalanced ( y_true , y_pred ) assert_equal ( _format_report ( report ) , expected_report )
test classification report with long string label .