I have the following classification report:
precision recall f1-score support
B-Origin 0.99 0.98 0.98 787
B-Opinion 0.90 0.85 0.88 41
I-Relationship 0.95 0.80 0.87 153
I-Year 0.93 0.97 0.95 285
I-Origin 0.94 0.90 0.92 570
How can I save the class names as strings in a list?
names = ["B-Origin", "B-Opinion", "I-Relationship", "I-Year", "I-Origin"]
>Solution :
report = classification_report(y_true, y_pred, output_dict=True)
dfReport = pandas.DataFrame(report).transpose()
myList = dfReport.index.tolist()