def test_evaluation_report():
 y_real = np.array([['a', 'b', 'c'], ['a', 'b', 'e', 'f', 'g'], ['a', 'b']])
 y_pred = np.array([['a', 'b', 'c'], ['a', 'b', 'c', 'd'], ['e', 'f']])
 labels = np.array(['user_id1', 'user_id2', 'user_id3'])
 expected_report = '             precision    recall  f1-score\n\n   user_id1       1.00      1.00      1.00\n   user_id2       0.40      0.50      0.44\n   user_id3       0.00      0.00      0.00\n\navg / total       0.47      0.50      0.48\n'
 report = evaluation_report(y_real, y_pred, target_names=labels)
 assert_equals(report, expected_report)
 expected_report = '             precision    recall  f1-score\n\n          0       1.00      1.00      1.00\n          1       0.40      0.50      0.44\n          2       0.00      0.00      0.00\n\navg / total       0.47      0.50      0.48\n'
 report = evaluation_report(y_real, y_pred)
 assert_equals(report, expected_report)

def test_evaluation_report ( ) : y_real = np . array ( [ [ 'a' , 'b' , 'c' ] , [ 'a' , 'b' , 'e' , 'f' , 'g' ] , [ 'a' , 'b' ] ] ) y_pred = np . array ( [ [ 'a' , 'b' , 'c' ] , [ 'a' , 'b' , 'c' , 'd' ] , [ 'e' , 'f' ] ] ) labels = np . array ( [ 'user_id1' , 'user_id2' , 'user_id3' ] ) expected_report = '             precision    recall  f1-score\n\n   user_id1       1.00      1.00      1.00\n   user_id2       0.40      0.50      0.44\n   user_id3       0.00      0.00      0.00\n\navg / total       0.47      0.50      0.48\n' report = evaluation_report ( y_real , y_pred , target_names = labels ) assert_equals ( report , expected_report ) expected_report = '             precision    recall  f1-score\n\n          0       1.00      1.00      1.00\n          1       0.40      0.50      0.44\n          2       0.00      0.00      0.00\n\navg / total       0.47      0.50      0.48\n' report = evaluation_report ( y_real , y_pred ) assert_equals ( report , expected_report )
test evaluation report .