y_true = [1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2] y_pred = [1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2] target_names = [ 'class 1', 'class 2'] result = metrics.classification_report_imbalanced(y_true, y_pred, target_names=target_names) print(result)