训练集、测试集、校验集

来源:互联网 发布:php 共享内存 加锁 编辑:程序博客网 时间:2024/05/01 03:17

之前做图像分类,只是用到了训练集和测试集,然后看到了校验集(validation set)的时候整个人都不好。

(一)

下面给出三个集合的定义

  • Training set is a subset of the dataset used to build predictive models.
  • Validation set is a subset of the dataset used to assess the performance of model built in the training phase. It provides a test platform for fine tuning model's parameters and selecting the best-performing model. Not all modeling algorithms need a validation set.
  • Test set or unseen examples is a subset of the dataset to assess the likely future performance of a model. If a model fit to the training set much better than it fits the test set, overfitting is probably the cause.


          训练集(training set)  是用来训练模型或确定模型参数的,如ANN中权值等;

          校验集(validation set)   是用来做模型选择(model selection),即做模型的最终优化及确定的,如ANN的结构;

          测试集(test set) 则纯粹是为了测试已经训练好的模型的推广能力。当然,test set这并不能保证模型的正确性,他只是说相似的数据用此模型会得出相似的结果。


    (二)

    一个典型的划分是训练集占总样本的50%,而其它各占25%,三部分都是从样本中随机抽取。


    (三)

    但实际应用中,一般只将数据集分成两类,即training set 和test set,大多数文章并不涉及validation set。

    常用的是留少部分做测试集。然后对其余N个样本采用K折交叉验证法。就是将样本打乱,然后均匀分成K份,轮流选择其中K-1份训练,剩余的一份做验证,计算预测误差平方和,最后把K次的预测误差平方和再做平均作为选择最优模型结构的依据。特别的K取N,就是留一法(leave one out)。

  • 0 0
    原创粉丝点击