1
$\begingroup$

I am working on deep learning with fer2013 dataset.
After training the model I got val_precision: 0.9168 (precision: 0.8492)

Epoch 67/100
238/238 [==============================] - 31s 130ms/step - loss: 1.5087 - tp: 2622.4142 - fp: 474.9121 - tn: 45584.3013 - fn: 5054.1213 - accuracy: 0.8972 - precision: 0.8492 - recall: 0.3410 - auc: 0.9042 - prc: 0.6758 - val_loss: 0.9754 - val_tp: 1389.0000 - val_fp: 126.0000 - val_tn: 22698.0000 - val_fn: 2415.0000 - val_accuracy: 0.9046 - **val_precision: 0.9168** - val_recall: 0.3651 - val_auc: 0.9235 - val_prc: 0.7276
Restoring model weights from the end of the best epoch.
Epoch 00067: early stopping


But when I output the "Confusion Matrix" I get precision of 0.13 - 0.18 ... enter image description here
I have some misunderstanding - why is my precision so different ?
Is this confusion matrix part has errors ?

Here is my notebook -> https://www.kaggle.com/code/prilia/emotion-recognition-with-resnet50-7emotions/notebook

Please help

$\endgroup$
3
  • 1
    $\begingroup$ Isn't that an $F_1$ score, not an accuracy? $\endgroup$
    – Dave
    May 3, 2022 at 16:01
  • $\begingroup$ hi, I updated the question. $\endgroup$
    – prilia
    May 3, 2022 at 16:37
  • 1
    $\begingroup$ I assume that the confusion matrix shows performance on the test set, right? This looks like overfitting to me. $\endgroup$
    – Erwan
    May 3, 2022 at 17:43

1 Answer 1

1
$\begingroup$

"precision: 0.8492" is on the training data. "val_precision: 0.9168" is on the validation data. "Confusion Matrix" is on the test data.

The precision values are different because they are three different data sets. One possible reason that the values are smaller on the test data set is that the model is overfitting to the training dataset.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.