应该避免过度拟合吗?
假设我们有2个模型。 训练精度为0.85的第一型模型 验证精度为0.78的第一型模型 第二型模型,训练精度为0.79 验证精度为0.77的第二模型。
哪个模型应该首选?还是即使第一款具有更高的精度,我还是更喜欢第二型模型?
Suppose we have 2 models..
1st model with training accuracy of 0.85
1st model with validation accuracy of 0.78
2nd model with training accuracy of 0.79
2nd model with validation accuracy of 0.77.
Which of the model should be preferred? Or shall i prefer 2nd model even though 1st one is having a higher accuracy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您分享的内容,我相信您应该选择第一个,因为它在验证数据上具有更高的精度。原因是您正在使用损失功能优化模型,旨在减少训练损失。因此,它可以过度地与您的数据合适,以便对您的培训损失产生良好的精度得分,而实际上它不能从培训数据中概括为数据。在您分享的内容中,我看到您手中有2个指标;也就是说,培训损失和验证损失。当您使用模型时,还应该拥有一个与这两个分开的测试数据集。您可以通过尝试提高验证数据的性能来培训培训数据,并为模型进行微调(选择超级参数)。选择模型后,您应该在测试数据集中对其进行评估,直到目前,您尚未将其介绍给模型。它将向您展示确实您的模型如何推广到看不见的数据。之所以这样做,是因为当训练时,您对模型在训练集上的性能进行了优化。当选择最佳的超参数时,您会偏向于验证集。鉴于,您从未在测试数据集中看到其性能,但从某种意义上说,它反映了您的模型在部署的现实世界中所面临的情况。希望这会有所帮助。
From what you have shared, I believe you should pick the first one since it has higher accuracy on the validation data. The reason is that you are optimizing your models with a loss function which aims to decrease the training loss. Therefore, it can overfit to your data to yield good accuracy scores on your training loss whereas in reality it cannot generalize to data out of your training data. In what you have shared I see that you have 2 metrics at your hand; namely, the training loss and the validation loss. When you are working on models, you should also have a test dataset which is separate from these two. You would train on your training data, and fine-tune(pick hyper parameters) for your model by trying to increase the performance on the validation data. After you have picked your model, you should evaluate it regarding its performance on the test dataset which you have not introduced to your model up to this point. It would show you really how your model generalizes to unseen data. The reason you do this is because when training you optimized your model regarding its performance on the training set. When picking the best hyper-parameters you were biased to do well on the validation set. Whereas, you have never seen its performance on the test dataset therefore, it in a sense reflects real world situations that your model would face if it were to be deployed. Hope this helps.