I am using sklearn.metrics.classification_report to evaluate the result of my classification.
y_pred = np.argmax(model.predict(X_test), axis=1)
y_true = np.argmax(y_test, axis=1)
print(classification_report(y_true, y_pred, target_names=list(le.classes_)))
And here is my result:
precision recall f1-score support
Technology 0.00 0.00 0.00 1
Travel 0.00 0.00 0.00 5
Fashion 0.00 0.00 0.00 25
Entertainment 0.72 1.00 0.84 130
Art 0.00 0.00 0.00 7
Politic 0.00 0.00 0.00 12
avg / total 0.52 0.72 0.61 180
The problem is actually I have 7 labels. The order goes Technology, Travel, Fashion, Entertainment, Art, Politic, Sports. Actually I don't have any Art label in my y_true result but the report lists in order so, it lists Art but skips Sports. It writes the result of Politic for Art and the result of Sports goes to Politic's row.
Why does not it skip the Art? I have no idea how can I solve this.