训练集、验证集、测试集的区别,这次你一定能看懂

疑惑点

我们其实主要搞不清验证集测试集的关系和区别,训练集大家都很清楚是干什么的。网上说了一大堆我也是没看懂,今天突然又看到这个东西,终于在stack overflow看到了一个很容易理解的解答,下面给大家分享一下。

训练集和验证集都是在训练阶段使用的!!!

相信你看了下面这段立马就明白了
----------------------------
for each epoch
    for each training data instance
        propagate error through the network
        adjust the weights
        calculate the accuracy over training data
    for each validation data instance
        calculate the accuracy over the validation data
    if the threshold validation accuracy is met
        exit training
    else
        continue training

一旦你完成了训练,那么你就对照你的测试集进行测试,并验证准确性是否足够。

在这里插入图片描述

详细解释

训练集:该数据集用于调整神经网络上的权重。
测试集:该数据集用于最小化过度拟合。 您没有使用此数据集调整网络的权重,您只是验证训练数据集的准确度的任何提高实际上都会提高准确性,而不是之前未向网络显示的数据集, 或者至少网络没有接受过培训(即验证数据集)。 如果训练数据集的准确度增加,但验证数据集的准确度保持不变或降低,则您的神经网络过度拟合,应该停止训练。
验证集:该数据集仅用于测试最终解决方案,以确认网络的实际预测能力。
(以上内容均来自Google翻译,有些地方翻译的可能不太通顺和精确,由于水平有限,大家将就看)


下面附上原文

链接:https://stackoverflow.com/questions/2976452/whats-is-the-difference-between-train-validation-and-test-set-in-neural-netwo

The training and validation sets are used during training.

for each epoch
    for each training data instance
        propagate error through the network
        adjust the weights
        calculate the accuracy over training data
    for each validation data instance
        calculate the accuracy over the validation data
    if the threshold validation accuracy is met
        exit training
    else
        continue training

Once you’re finished training, then you run against your testing set and verify that the accuracy is sufficient.

Training Set: this data set is used to adjust the weights on the neural network.

Validation Set: this data set is used to minimize overfitting. You’re not adjusting the weights of the network with this data set, you’re just verifying that any increase in accuracy over the training data set actually yields an increase in accuracy over a data set that has not been shown to the network before, or at least the network hasn’t trained on it (i.e. validation data set). If the accuracy over the training data set increases, but the accuracy over the validation data set stays the same or decreases, then you’re overfitting your neural network and you should stop training.

Testing Set: this data set is used only for testing the final solution in order to confirm the actual predictive power of the network.

评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值