第22章付録:深層学習のための数学
22.9.3. The Naive Bayes Classifier22.9.3 ナイーブベイズ分類器
Fortunately, by making some assumptions about conditional independence, we can introduce some inductive bias and build a model capable of generalizing from a comparatively modest selection of training examples. To begin, let’s use Bayes theorem, to express the classifier as
英語のヒント
幸い、条件付き独立について何らかの仮定を置くことで、帰納バイアスを導入し、比較的控えめな量の訓練例から汎化できるモデルを作れる。まず、ベイズの定理を使って、分類器を次のように表そう。
(22.9.2)
Note that the denominator is the normalizing term which does not depend on the value of the label . As a result, we only need to worry about comparing the numerator across different values of . Even if calculating the denominator turned out to be intractable, we could get away with ignoring it, so long as we could evaluate the numerator. Fortunately, even if we wanted to recover the normalizing constant, we could. We can always recover the normalization term since .
英語のヒント
分母は正規化項であり、ラベルの値に依存しないことに注意しよう。その結果、の異なる値の間で分子を比べることだけを気にすればよい。分母の計算が手に負えないとわかったとしても、分子を評価できるかぎり、分母を無視して済ませられる。幸い、正規化定数を取り戻したいとしても、それはできる。なので、正規化項はいつでも取り戻せる。
Now, let’s focus on . Using the chain rule of probability, we can express the term as
英語のヒント
では、に焦点を当てよう。確率の連鎖律を使うと、項は次のように表せる。
(22.9.3)
By itself, this expression does not get us any further. We still must estimate roughly parameters. However, if we assume that the features are conditionally independent of each other, given the label, then suddenly we are in much better shape, as this term simplifies to , giving us the predictor
英語のヒント
それだけでは、この式はこれ以上先に進ませてくれない。依然としておよそ個のパラメータを推定しなければならない。しかし、ラベルが与えられたもとで特徴が互いに条件付き独立だと仮定すると、この項はに単純化されるので、急にずっとよい状態になり、次の予測器が得られる。
(22.9.4)
If we can estimate for every and , and save its value in , here is a matrix with being the number of classes and , then we can also use this to estimate , i.e.,
英語のヒント
すべてのとについてを推定し、その値をに保存できれば(ここでは行列で、はクラスの数、である)、これを使っても推定できる。つまり、
(22.9.5)
In addition, we estimate for every and save it in , with a -length vector. Then, for any new example , we could compute
英語のヒント
さらに、すべてのについてを推定し、それをに保存する。ここでは長さのベクトルである。すると、任意の新しい例について、次を計算できる。
(22.9.6)
for any . So our assumption of conditional independence has taken the complexity of our model from an exponential dependence on the number of features to a linear dependence, which is .
英語のヒント
これは任意のについてである。したがって、条件付き独立の仮定によって、モデルの計算量は、特徴の数への指数的な依存から、線形の依存になった。