2016年5月24日 星期二

[Machine Learing] Training set 6: cross validation set 2: testing set 2

我们首先定义train、cv(cross validation)和test error。
之后我们根据train error训练模型。如果是模型比较时,我们就训练出多个不同的模型,如上图。
之后,对于模型选择。我们让cross validation set通过的这些模型,并计算这些模型的error(cv error)。我们选cv error最小的那个模型作为最好的模型。
最后,对于估计模型的performance(也就是generalization):我们让   test set通过我们刚刚用cv error选出的模型,得到test error,作为performance。
需要强调的是,如果不做模型选择,那么就不需要validation set了。只要training和test set。两者的比例大概是7:3。
然后,这里解释下为什么做模型选择要validation set和test set分开。首先我们不能拿training set做模型选择,因为那样没有generalization了(我们的算法就是根据training set来优化模型的,所以没有再用这个set做模型选择没意义)。其次,如果我们用test set选模型,那么选择的模型就fit到 test set,结果我们同样失去了generalization。所以要用validation set选模型。用test set测generalization。
=>
Use cross validation set to chose polynomial model (theta from training set), use testing set data to judge the performance of model which you just get. 

****
If you do not have to select model, then just use training set 7 : testing set 3 .

沒有留言:

張貼留言