第4章分類のための線形ニューラルネットワーク
4.6.1. The Test Set4.6.1 テスト集合
Since we have already begun to rely on test sets as the gold standard method for assessing generalization error, let’s get started by discussing the properties of such error estimates. Let’s focus on a fixed classifier , without worrying about how it was obtained. Moreover suppose that we possess a fresh dataset of examples that were not used to train the classifier . The empirical error of our classifier on is simply the fraction of instances for which the prediction disagrees with the true label , and is given by the following expression:
英語のヒント
汎化誤差を評価するための最も信頼できる方法として、すでにテスト集合に頼り始めているので、まずはこうした誤差の推定値の性質を論じることから始めよう。どのように得られたかは気にせず、固定した分類器に注目しよう。さらに、分類器の訓練には使われなかった、新しい事例のデータセットをもっているとしよう。での分類器の経験誤差は、単に、予測が真のラベルと一致しないインスタンスの割合であり、次の式で与えられる。
(4.6.1)
By contrast, the population error is the expected fraction of examples in the underlying population (some distribution characterized by probability density function ) for which our classifier disagrees with the true label:
英語のヒント
これに対して、母集団誤差は、背後にある母集団(確率密度関数で特徴づけられる、ある分布)の事例のうち、分類器が真のラベルと一致しないものの割合の期待値である。
(4.6.2)
While is the quantity that we actually care about, we cannot observe it directly, just as we cannot directly observe the average height in a large population without measuring every single person. We can only estimate this quantity based on samples. Because our test set is statistically representative of the underlying population, we can view as a statistical estimator of the population error . Moreover, because our quantity of interest is an expectation (of the random variable ) and the corresponding estimator is the sample average, estimating the population error is simply the classic problem of mean estimation, which you may recall from Section 2.6.
英語のヒント
こそ実際に気にかける量だが、それを直接観測することはできない。大きな集団の平均身長を、一人残らず測らずには直接観測できないのと同じである。この量は標本にもとづいて推定することしかできない。テスト集合は背後にある母集団を統計的に代表しているので、を母集団誤差の統計的な推定量とみなせる。さらに、関心のある量は(確率変数の)期待値であり、対応する推定量は標本平均なので、母集団誤差の推定は、単に平均の推定という古典的な問題である。これは2.6節で扱ったので覚えているかもしれない。
An important classical result from probability theory called the central limit theorem guarantees that whenever we possess random samples drawn from any distribution with mean and standard deviation , then, as the number of samples approaches infinity, the sample average approximately tends towards a normal distribution centered at the true mean and with standard deviation . Already, this tells us something important: as the number of examples grows large, our test error should approach the true error at a rate of . Thus, to estimate our test error twice as precisely, we must collect four times as large a test set. To reduce our test error by a factor of one hundred, we must collect ten thousand times as large a test set. In general, such a rate of is often the best we can hope for in statistics.
英語のヒント
中心極限定理と呼ばれる確率論の重要な古典的結果によれば、平均、標準偏差のどんな分布から取り出した個の無作為な標本があるときでも、標本の数が無限大に近づくにつれて、標本平均はおおよそ、真の平均を中心とし標準偏差がの正規分布に近づいていく。これだけでもう、重要なことがわかる。事例の数が大きくなるにつれて、テスト誤差はの速さで真の誤差に近づくはずである。したがって、テスト誤差を2倍の精度で推定するには、4倍の大きさのテスト集合を集めなければならない。テスト誤差を100分の1に減らすには、1万倍の大きさのテスト集合を集めなければならない。一般に、こうしたという速さは、統計学で望みうる最善であることが多い。
Now that we know something about the asymptotic rate at which our test error converges to the true error , we can zoom in on some important details. Recall that the random variable of interest can only take values and and thus is a Bernoulli random variable, characterized by a parameter indicating the probability that it takes value . Here, means that our classifier made an error, so the parameter of our random variable is actually the true error rate . The variance of a Bernoulli depends on its parameter (here, ) according to the expression . While is initially unknown, we know that it cannot be greater than . A little investigation of this function reveals that our variance is highest when the true error rate is close to and can be far lower when it is close to or close to . This tells us that the asymptotic standard deviation of our estimate of the error (over the choice of the test samples) cannot be any greater than .
英語のヒント
テスト誤差が真の誤差に収束する漸近的な速さについて少しわかったので、いくつかの重要な細部に目を寄せることができる。関心のある確率変数は値としかとれず、したがってベルヌーイ確率変数であることを思い出してほしい。これは、値をとる確率を示す一つのパラメータで特徴づけられる。ここでは分類器が誤りを犯したことを意味するので、この確率変数のパラメータは、実は真の誤り率である。ベルヌーイ分布の分散は、そのパラメータ(ここでは)に依存し、式で与えられる。は最初は未知だが、より大きくなりえないことはわかっている。この関数を少し調べると、分散は真の誤り率がに近いときに最も大きく、やに近いときにははるかに小さくなりうることがわかる。このことから、(個のテスト標本の選び方にわたる)誤差の推定値の漸近的な標準偏差は、より大きくなりえないことがわかる。
If we ignore the fact that this rate characterizes behavior as the test set size approaches infinity rather than when we possess finite samples, this tells us that if we want our test error to approximate the population error such that one standard deviation corresponds to an interval of , then we should collect roughly 2500 samples. If we want to fit two standard deviations in that range and thus be 95% confident that , then we will need 10,000 samples!
英語のヒント
この速さが表しているのは、有限の標本をもつときではなく、テスト集合の大きさが無限大に近づくときのふるまいだという事実を無視すれば、次のことがわかる。テスト誤差が母集団誤差を近似し、標準偏差一つ分がの区間に対応するようにしたいなら、およそ2500個の標本を集めるべきである。その範囲に標準偏差二つ分を収め、であると95%の確信をもちたいなら、10,000個の標本が必要になる!
This turns out to be the size of the test sets for many popular benchmarks in machine learning. You might be surprised to find out that thousands of applied deep learning papers get published every year making a big deal out of error rate improvements of or less. Of course, when the error rates are much closer to , then an improvement of can indeed be a big deal.
英語のヒント
これは、機械学習でよく使われる多くのベンチマークのテスト集合の大きさであることがわかる。誤り率の以下の改善を大ごとのように扱う応用深層学習の論文が、毎年何千本も出版されていると知ったら驚くかもしれない。もちろん、誤り率がにずっと近いときには、の改善は実際に大ごとでありうる。
One pesky feature of our analysis thus far is that it really only tells us about asymptotics, i.e., how the relationship between and evolves as our sample size goes to infinity. Fortunately, because our random variable is bounded, we can obtain valid finite sample bounds by applying an inequality due to Hoeffding (1963):
英語のヒント
これまでの分析の厄介な点の一つは、それが実は漸近的なふるまい、つまり標本の大きさが無限大に向かうにつれてとの関係がどう変わるかについてしか教えてくれないことである。幸い、この確率変数は有界なので、Hoeffding(1963)による不等式を当てはめれば、有限の標本について正しい界を得られる。
(4.6.3)
Solving for the smallest dataset size that would allow us to conclude with 95% confidence that the distance between our estimate and the true error rate does not exceed , you will find that roughly 15,000 examples are required as compared to the 10,000 examples suggested by the asymptotic analysis above. If you go deeper into statistics you will find that this trend holds generally. Guarantees that hold even in finite samples are typically slightly more conservative. Note that in the scheme of things, these numbers are not so far apart, reflecting the general usefulness of asymptotic analysis for giving us ballpark figures even if they are not guarantees we can take to court.
英語のヒント
推定値と真の誤り率の距離がを超えないと95%の確信をもって結論できる、最小のデータセットの大きさを求めると、上の漸近的な分析が示した10,000個に比べて、およそ15,000個の事例が必要になることがわかる。統計学をもっと深く学べば、この傾向が一般に成り立つことがわかる。有限の標本でも成り立つ保証は、ふつう少しだけ保守的である。大きな目で見れば、これらの数はそれほどかけ離れていないことに注意してほしい。これは、法廷に持ち込めるような保証ではないにしても、おおよその見当を与えるうえで漸近的な分析が一般に役立つことを表している。