2
$\begingroup$

Below, you have the accuracy plots for training and testing set for 6 different neural networks. is it possible to say, which of the following neural network classifier is better?. Having this little known information (training and testing accuracy by number of epochs plot) ? . Personally, I believe, the first classifier (top-left corner) is better because it shows that the accuracy of the testing data is stable as the number of epochs increases.

6 different models

$\endgroup$
  • $\begingroup$ Your plots are slightly different in scale, consider using a fixed range for y-axis (plt.ylim([80,100]) or [0,100] would be best $\endgroup$ – Pedro Henrique Monforte Apr 11 '19 at 0:50
2
$\begingroup$

There are several issues you should consider before choosing the best classifier.

Precision, recall and F-score

It is highly recommended that you also check precision, recall and F-score metrics in addition to accuracy. That's because if your dataset have imbalanced labels (for example when 90% of labels are positive and only 10% are negative) considering just accuracy may mislead you. For example in this case if you choose a classifier that always outputs 1, it will have 90% accuracy but it will fail to work well on unseen data. In such cases, precision, recall and F-score comes in handy.

Validation and test set

In addition to the test set, you should set aside a validation set and tune the hyper-parameters of your model using this set. If you use the test set to tune the hyper-parameters of your model, you can not expect your model to generalize well so it performs poorly on unseen data.

Overfitting and underfitting

Overfitting happens when your model performs dramatically well on training dataset but poorly on validation and test set. Underfitting happens when your model performs poorly on training dataset. To ensure that you are not underfitting or overfitting, you should check the performance of your model on the training and validation datasets, simultaneously.

So, first you should change your accuracy plots so it shows training and validation loss instead. Then, we consider choosing the best model. If after some epochs, the training score is still low, you are underfitting. If training score is much higher than validation score, you are overfitting. The best case is when training and validation scores are close together after enough epochs.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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