且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Keras顺序模型中使用的验证数据是什么?

更新时间:2023-12-01 23:42:52

如果要构建实体模型,则必须遵循将数据分为三组的特定协议:一个用于培训 ,一个用于验证,另一个用于最终评估,即测试集.

If you want to build a solid model you have to follow that specific protocol of splitting your data into three sets: One for training, one for validation and one for final evaluation, which is the test set.

这个想法是,您训练自己的训练数据,并使用从验证集中获得的指标(准确性,损失等)的结果来调整模型.

The idea is that you train on your training data and tune your model with the results of metrics (accuracy, loss etc) that you get from your validation set.

您的模型没有看到"您的验证集,也没有对其进行任何培训,但是您作为超参数的设计者和主人可以根据该数据调整模型. 因此它间接影响您的模型,因为它直接影响您的设计决策.您轻推模型以使其与验证数据一起很好地工作,并且可能会引起倾斜.

Your model doesn't "see" your validation set and isn´t in any way trained on it, but you as the architect and master of the hyperparameters tune the model according to this data. Therefore it indirectly influences your model because it directly influences your design decisions. You nudge your model to work well with the validation data and that can possibly bring in a tilt.

这正是您仅根据模型和您自己未使用的数据评估模型最终得分的原因-这是第三组数据,即测试集.

Exactly that is the reason you only evaluate your models final score on data that neither your model nor you yourself has used – and that is the third chunk of data, your test set.

仅此过程可确保您对模型的质量和对从完全看不见的数据中学到的知识进行概括的能力有完整的了解.

Only this procedure makes sure you get an unaffected view of your models quality and ability to generalize what is has learned on totally unseen data.