Nachiket
Nachiket

Reputation: 182

Difference between model accuracy from test data and confusion matrix accuracy

Question

What is the difference between both the accuracy's which one should be considered as the actual accuracy? and why?

Code on test set

loss, acc = model.evaluate(Xtest, y_test_array)

Upvotes: 0

Views: 258

Answers (1)

David Dale
David Dale

Reputation: 11434

It looks like your dataset has class imbalance, and the metric calculated from confusion matrix (it is NOT accuracy - probably, it is something like F1 score) is low because the minority class is recognized poorly. At the same time, accuracy is high because the majority class is recognized well.

Upvotes: 1

Related Questions