第3章回帰のための線形ニューラルネットワーク
3.6.3. Model Selection3.6.3 モデルの選択
Typically, we select our final model only after evaluating multiple models that differ in various ways (different architectures, training objectives, selected features, data preprocessing, learning rates, etc.). Choosing among many models is aptly called model selection.
英語のヒント
普通、最終的なモデルを選ぶのは、さまざまな点で異なる(アーキテクチャ、訓練の目的、選んだ特徴量、データの前処理、学習率などが異なる)複数のモデルを評価した後である。多くのモデルのなかから選ぶことを、まさにぴったりの言葉でモデル選択という。
In principle, we should not touch our test set until after we have chosen all our hyperparameters. Were we to use the test data in the model selection process, there is a risk that we might overfit the test data. Then we would be in serious trouble. If we overfit our training data, there is always the evaluation on test data to keep us honest. But if we overfit the test data, how would we ever know? See Ong et al. (2005) for an example of how this can lead to absurd results even for models where the complexity can be tightly controlled.
英語のヒント
原則として、ハイパーパラメータをすべて選び終えるまで、テスト集合に触れてはならない。モデル選択の過程でテストデータを使うと、テストデータに過学習するおそれがある。そうなると深刻な事態になる。訓練データに過学習しても、テストデータでの評価があれば正直でいられる。しかし、テストデータに過学習したら、どうやってそれを知ればよいのか。複雑さを厳しく制御できるモデルでさえ、これがばかげた結果につながりうる例として、Ong et al. (2005)を見てほしい。
Thus, we should never rely on the test data for model selection. And yet we cannot rely solely on the training data for model selection either because we cannot estimate the generalization error on the very data that we use to train the model.
英語のヒント
したがって、モデル選択にテストデータに頼ってはならない。かといって、モデル選択に訓練データだけに頼ることもできない。モデルを訓練するのに使うまさにそのデータで、汎化誤差を推定することはできないからである。
In practical applications, the picture gets muddier. While ideally we would only touch the test data once, to assess the very best model or to compare a small number of models with each other, real-world test data is seldom discarded after just one use. We can seldom afford a new test set for each round of experiments. In fact, recycling benchmark data for decades can have a significant impact on the development of algorithms, e.g., for image classification and optical character recognition.
英語のヒント
The common practice for addressing the problem of training on the test set is to split our data three ways, incorporating a validation set in addition to the training and test datasets. The result is a murky business where the boundaries between validation and test data are worryingly ambiguous. Unless explicitly stated otherwise, in the experiments in this book we are really working with what should rightly be called training data and validation data, with no true test sets. Therefore, the accuracy reported in each experiment of the book is really the validation accuracy and not a true test set accuracy.
英語のヒント
テスト集合で訓練してしまうという問題に対処するよくある方法は、データを3通りに分け、訓練データセットとテストデータセットに加えて検証集合を取り入れることである。その結果、検証データとテストデータの境界が気がかりなほどあいまいな、はっきりしない状況になる。特に明記しないかぎり、この本の実験で私たちが扱っているのは、本当は訓練データと検証データと呼ぶべきもので、本当のテスト集合はない。したがって、この本の各実験で報告する正解率は、実際には検証での正解率であり、本当のテスト集合での正解率ではない。
3.6.3.1. Cross-Validation3.6.3.1 交差検証
When training data is scarce, we might not even be able to afford to hold out enough data to constitute a proper validation set. One popular solution to this problem is to employ -fold cross-validation. Here, the original training data is split into non-overlapping subsets. Then model training and validation are executed times, each time training on subsets and validating on a different subset (the one not used for training in that round). Finally, the training and validation errors are estimated by averaging over the results from the experiments.
英語のヒント
訓練データが乏しいときは、適切な検証集合を構成するのに十分なデータを取り分けておく余裕さえないかもしれない。この問題によく使われる解決策の一つは、分割交差検証を使うことである。ここでは、元の訓練データを重なりのない個の部分集合に分ける。そして、モデルの訓練と検証を回行い、毎回個の部分集合で訓練し、別の部分集合(その回の訓練に使わなかったもの)で検証する。最後に、回の実験の結果を平均して、訓練誤差と検証誤差を推定する。