「《サポート・ベクター・マシン》」の版間の差分

提供: ORWiki
ナビゲーションに移動 検索に移動
3行目: 3行目:
 
 サポート・ベクター・マシン (SVM) は, 判別関数を求める教師付き学習法のひとつである.  
 
 サポート・ベクター・マシン (SVM) は, 判別関数を求める教師付き学習法のひとつである.  
  
 今, <math>N</math>個の属性を持ったデータが<math>M</math>個与えられており,これを,<math>N</math>次元空間<math>\boldsymbol{R}^{N}</math>の点<math>{ }_{1},{ }_{2},\ldots, { }_{M} \in \boldsymbol{R}^{N}</math>と考える. 各点<math>{ }_{j}\ (j=1,2,\ldots,M)</math>は2種類のクラスのいづれか一方に属しており, 対応する2値のラベル<math>y_{j} \in \{-1,+1\}</math>が与えられているとする. このとき, ラベルの値にしたがって点を判別する2クラスの判別問題を考える.
+
 今, <math>N\, </math>個の属性を持ったデータが<math>M\, </math>個与えられており,これを,<math>N\, </math>次元空間<math>\boldsymbol{R}^{N}\, </math>の点<math>{ }_{1},{ }_{2},\ldots, { }_{M} \in \boldsymbol{R}^{N}\, </math>と考える. 各点<math>{ }_{j}\ (j=1,2,\ldots,M)\, </math>は2種類のクラスのいづれか一方に属しており, 対応する2値のラベル<math>y_{j} \in \{-1,+1\}\, </math>が与えられているとする. このとき, ラベルの値にしたがって点を判別する2クラスの判別問題を考える.
  
 SVMでは線形関数を用いた判別を行う. <math>N</math>次元の法線ベクトルおよび実数<math>b</math>で定まる線形関数を<math>f( ) = \ ^{T} \ - b</math> とすれば, 与えられたデータおよびラベルにしたがって,
+
 SVMでは線形関数を用いた判別を行う. <math>N\, </math>次元の法線ベクトルおよび実数<math>b\,\, </math>で定まる線形関数を<math>f( ) = { }^{T} \ - b\, </math> とすれば, 与えられたデータおよびラベ:ルにしたがって,
  
  
15行目: 15行目:
 
\end{array}
 
\end{array}
 
\right.\quad j=1,2,\ldots,M
 
\right.\quad j=1,2,\ldots,M
</math>    <math>(1)</math>
+
\, </math>    <math>(1)\, </math>
  
  
となるベクトルとスカラ<math>b</math>を次に示す最適化問題を解くことで算出する.
+
となるベクトルとスカラ<math>b\, </math>を次に示す最適化問題を解くことで算出する.
  
 一般的には, 与えられた点全てに対して式 (1) を満たす<math>\,b</math>が存在するとは限らないので, 非負の変数<math>\xi_{j}\ (j=1,2,\ldots,M)</math>を導入し, 次の制約条件
+
 一般的には, 与えられた点全てに対して式 (1) を満たす<math>\,b\, </math>が存在するとは限らないので, 非負の変数<math>\xi_{j}\ (j=1,2,\ldots,M)\, </math>を導入し, 次の制約条件
  
  
30行目: 30行目:
 
   & \mbox{if}& y_{j} = -1
 
   & \mbox{if}& y_{j} = -1
 
\end{array}
 
\end{array}
</math>    <math>(2)</math>
+
\, </math>    <math>(2)\, </math>
  
  
のもと,<math>\xi_{j}</math>の和とのノルムができるだけ小さくなる線形関数を考える. すなわち, 次の二次計画問題を解き<math>\,b</math>を算出する [2].
+
のもと,<math>\xi_{j}\, </math>の和とのノルムができるだけ小さくなる線形関数を考える. すなわち, 次の二次計画問題を解き<math>\,b\, </math>を算出する [2].
  
 
+
:    <math>(3)\, </math>
:<math>\begin{array}{l}\left|
+
:最大化
\\
+
:制約
\\
+
:<math>
\\
+
\begin{array}{ll}
\end{array}</math>最小化  <math>{  \displaystyle
+
  &{  \textstyle \frac{1}{2}\| \| \frac{2}{2} + C \ {\sum}_{j=1}^{M} \xi_{j}}\\
      \frac{1}{2}\|\\|_{2}^{2} + C \sum_{j=1}^{M} \xi_{j}
+
   &{ \textstyle
    }</math>制約
 
<math>\begin{array}{ll}
 
   &{ % \displaystyle
 
 
       { }_{j}^{T} \ - b + \xi_{j} \geq 1,
 
       { }_{j}^{T} \ - b + \xi_{j} \geq 1,
 
         \quad \mbox{if } y_{j} = 1,}\\
 
         \quad \mbox{if } y_{j} = 1,}\\
   & { % \displaystyle
+
   & { \textstyle
 
       { }_{j}^{T} \ - b - \xi_{j} \leq -1,
 
       { }_{j}^{T} \ - b - \xi_{j} \leq -1,
 
         \quad \mbox{if } y_{j} = -1,}\\
 
         \quad \mbox{if } y_{j} = -1,}\\
   & { % \displaystyle
+
   & { \textstyle
 
       \xi_{j} \ge 0, \quad j=1,2,\ldots,M}
 
       \xi_{j} \ge 0, \quad j=1,2,\ldots,M}
\end{array}</math>
+
\end{array}\, </math>
 
 
 
 
  
ここで,<math>C</math>はあらかじめ設定された正の定数で, <math>\|\\|^{2}_{2}と\sum_{j=1}^{M} \xi_{j}</math>とのバランスをコントロールするパラメータである. また, <math>\|\\|^{2}_{2}</math>は正則化項とも呼ばれ, これを小さくすることは判別関数に用いるデータの属性を少なくし, 過学習を防ぐ役割があるとされる [6]. 問題 (3) は, 1ノルムソフトマージンSVMと呼ばれる定式化である.
 
  
 通常は,この問題の双対問題を考え最適化を行う [5]. <math>\alpha_{1},\alpha_{2},\ldots,\alpha_{M}</math> を双対変数とすれば, 問題 (3) の双対問題は
+
ここで,<math>C\, </math>はあらかじめ設定された正の定数で, <math>\textstyle \| \|\frac{2}{2}\, </math>と<math>\textstyle {\sum}_{j=1}^{M} \xi_{j}\, </math>とのバランスをコントロールするパラメータである. また, <math>\textstyle \| \|\frac{2}{2}\, </math>は正則化項とも呼ばれ, これを小さくすることは判別関数に用いるデータの属性を少なくし, 過学習を防ぐ役割があるとされる [6]. 問題 (3) は, 1ノルムソフトマージンSVMと呼ばれる定式化である.
  
 +
 通常は,この問題の双対問題を考え最適化を行う [5]. <math>\alpha_{1},\alpha_{2},\ldots,\alpha_{M}\, </math> を双対変数とすれば, 問題 (3) の双対問題は
  
\begin{equation}
+
:    <math>(4)\, </math>
\left|
+
:最大化
\begin{array}{ll}
+
:制約
\mbox{最大化}
+
:<math>\begin{array}{ll}
   & { %\displaystyle
+
   & { \textstyle
 
       - \frac{1}{2} \sum_{i=1}^{M}\sum_{j=1}^{M}
 
       - \frac{1}{2} \sum_{i=1}^{M}\sum_{j=1}^{M}
 
         y_{i}y_{j}{ }_{i}^{T}{ }_{j}\alpha_{i}\alpha_{j}
 
         y_{i}y_{j}{ }_{i}^{T}{ }_{j}\alpha_{i}\alpha_{j}
 
       + \sum_{j=1}^{M} \alpha_{j}
 
       + \sum_{j=1}^{M} \alpha_{j}
 
     }\\
 
     }\\
\mbox{制約}
+
   & { \textstyle
   & { %\displaystyle
 
 
       \sum_{j=1}^{M} y_{j} \alpha_{j}= 0,
 
       \sum_{j=1}^{M} y_{j} \alpha_{j}= 0,
 
     }\\
 
     }\\
 
   & { 0 \leq \alpha_{j} \leq C,\quad j=1,2,\ldots,M
 
   & { 0 \leq \alpha_{j} \leq C,\quad j=1,2,\ldots,M
 
     }
 
     }
\end{array}
+
\end{array}\, </math>
\right.
+
 
\label{eq:StandradWolfeDualwithQ}
 
\end{equation}
 
  
 +
と書くことができ, これは1本の等式制約と各変数の上下限制約のみの凹二次関数の最大化となる. この特殊構造を用いた最適化アルゴリズム [3, 4] が知られており, データ数<math>(M)\, </math>が数10万を超えるような大規模問題であっても, 高速に最適化が可能である.
  
と書くことができ, これは1本の等式制約と各変数の上下限制約のみの凹二次関数の最大化となる. この特殊構造を用いた最適化アルゴリズム [3, 4] が知られており, データ数<math>(M)</math>が数10万を超えるような大規模問題であっても, 高速に最適化が可能である.
+
 双対問題 (4) の最適解を<math>\alpha^{*}_{1},\alpha^{*}_{2},\ldots,\alpha^{*}_{M}\, </math>とすれば,KKT条件より主問題 (3) の最適解<math>^{*},b^{*}\, </math>とは, <math>\textstyle ^{*} = \sum_{j=1}^{M} \alpha_{j}^{*} y_{j} { }_{j}\, </math>となる関係があり, さらに<math>0<\alpha_{k}^{*}<C\, </math>となる添え字を<math>k\, </math>とすれば, <math>b^{*} = { }^{T}_{k} \ ^{*}-y_{k}\, </math>となることが示される. また, 特に添え字の集合<math>SV=\{j|\alpha_{j}^{*} \not = 0 \}\, </math>を定義すれば,<math>j \in SV\, </math>に対応するデータ<math>{ }_{j}\, </math>をサポート・ベクターと呼ぶ.したがって, 判別関数は双対問題の最適解とサポート・ベクターにより次のように表されることとなる.
  
 双対問題 (4) の最適解を<math>\alpha^{*}_{1},\alpha^{*}_{2},\ldots,\alpha^{*}_{M}</math>とすれば,KKT条件より主問題 (3) の最適解<math>\^{*},b^{*}とは, \^{*} = \sum_{j=1}^{M} \alpha_{j}^{*} y_{j} { }_{j}</math>となる関係があり, さらに<math>0<\alpha_{k}^{*}<C</math>となる添え字を<math>k</math>とすれば, <math>b^{*} = { }^{T}_{k}\^{*}-y_{k}</math>となることが示される. また, 特に添え字の集合<math>SV=\{j|\alpha_{j}^{*} \not = 0 \}</math>を定義すれば,<math>j \in SV</math>に対応するデータ<math>{ }_{j}</math>をサポート・ベクターと呼ぶ.したがって, 判別関数は双対問題の最適解とサポート・ベクターにより次のように表されることとなる.
 
  
 +
:<math> f( ) = { }^{T} \ ^{*} - b^{*}
 +
        = \sum_{j \in SV} \alpha_{j}^{*} y_{j}^{T} { }_{j} - b^{*}\, </math>     <math>(5)\, </math>
  
\begin{equation}
 
\label{eq:線形判別関数}
 
f(\Vx) = \Vx^{T} \^{*} - b^{*}
 
        = \sum_{j \in SV} \alpha_{j}^{*} y_{j}
 
                      \Vx^{T} { }_{j} - b^{*}
 
\end{equation}
 
  
 +
さらに, 双対問題 (4) や主問題 (3) は, サポート・ベクター以外を全て取り除いても最適解は不変であり, これらの点はSVMでの判別にはまったく寄与していないことになる.
  
さらに, 双対問題 (4) や主問題 (3) ,サポート・ベクター以外を全て取り除いても最適解は不変であり, これらの点はSVMでの判別にはまったく寄与していないことになる.
+
 SVMの最大の特徴は, 双対問題(4)を応用することで非線形な判別関数を構成できる点にある. 非線形な判別関数を構成するためには, まず, 適当な非線形変換<math>\phi: \boldsymbol{R}^{N} \to {\mathcal F}\, </math>を使い各データ<math>{ }_{j}\, </math>をより高い次元の特徴空間<math>{\mathcal F}\, </math>の元へと射影する. 射影された<math>{\mathcal F}\, </math>の元<math>\phi({ }_{1}),\phi({ }_{2}),\ldots,\phi({ }_{M})\, </math>に対して, <math>{\mathcal F}\, </math>上での線形な判別関数を求めれば, 元の空間で見れば非線形な判別関数を求めたこととなる.
  
 SVMの最大の特徴は, 双対問題(4)を応用することで非線形な判別関数を構成できる点にある.非線形な判別関数を構成するためには, まず, 適当な非線形変換<math>\phi: \boldsymbol{R}^{N} \to {\mathcal F}</math>を使い各データ<math>{ }_{j}</math>をより高い次元の特徴空間<math>{\mathcal F}</math>の元へと射影する. 射影された<math>{\mathcal F}</math>の元<math>\phi({ }_{1}),\phi({ }_{2}),\ldots,\phi({ }_{M})</math>に対して, <math>{\mathcal F}</math>上での線形な判別関数を求めれば, 元の空間で見れば非線形な判別関数を求めたこととなる.
+
 ここで, 双対問題 (4) に注目すれば,<math>{\mathcal F}\, </math>上の内積<math>\phi({ }_{i})^{T}\phi({ }_{j})\, </math>の値のみが得られれば定式化が可能であり, 特徴空間での点<math>\phi({ }_{j})\, </math>の座標を必ずしも必要としないことが分かる. そこで, SVMではカーネル関数と呼ばれる特殊な関数<math>{\cdot}{\cdot}\, </math>を用い元のデータ<math>, ' \in \boldsymbol{R}^{N}\, </math>から直接<math>{\mathcal F}\, </math>の元<math>\phi(),\phi(')\, </math>の内積<math>\phi()^{T}\phi(')\, </math>を算出し, 双対問題の最適化により非線形の判別関数が求められる [1]. よく用いられる代表的なカーネル関数として, 多項式カーネル<math>' = \left( { }^{T}\, ' + c \right)^{d}\,</math> やRBFカーネル <math>' = \exp\left( -\| \ - ' \|^{2}/ \sigma^{2} \right )\, </math>, (ただし<math>d\, </math>は自然数のパラメータ, <math>c,\sigma\, </math> は実数のパラメータである) などがある.
  
 ここで, 双対問題 (4) に注目すれば,<math>{\mathcal F}</math>上の内積<math>\phi({ }_{i})^{T}\phi({ }_{j})</math>の値のみが得られれば定式化が可能であり, 特徴空間での点<math>\phi({ }_{j})</math>の座標を必ずしも必要としないことが分かる. そこで, SVMではカーネル関数と呼ばれる特殊な関数<math>\kernel{\cdot}{\cdot}</math>を用い元のデータ<math>\Vx,\Vx' \in \boldsymbol{R}^{N}</math>から直接<math>{\mathcal F}</math>の元<math>\phi(\Vx),\phi(\Vx')</math>の内積<math>\phi(\Vx)^{T}\phi(\Vx')</math>を算出し, 双対問題の最適化により非線形の判別関数が求められる [1]. よく用いられる代表的なカーネル関数として, 多項式カーネル<math>\kernel{\Vx}{\Vx'} = \left( \Vx^{T} \Vx' + c \right)^{d}</math>やRBFカーネル <math>\kernel{\Vx}{\Vx'} = \exp\left( -\| \Vx - \Vx' \|^{2}/ \sigma^{2} \right )</math>,(ただし<math>d</math>は自然数のパラメータ, <math>c,\sigma</math> は実数のパラメータである)などがある.
 
  
 カーネル関数の値<math>\kernel{{ }_{i}}{{ }_{j}}</math>を<math>i-j</math>成分とする<math>M</math>次の対称行列を<math>K</math>とすれば,Kが半正定値行列となるようなカーネル関数をMercerカーネル(あるいは半正定値カーネル)と呼び, このようなカーネル関数であれば,<math>\kernel{{ }_{i}}{{ }_{j}}=\phi({ }_{i})^{T}\phi({ }_{j})</math>となる特徴空間への変換<math>\phi(\cdot)</math>が存在することが保証される. 多項式カーネルやRBFカーネルはMercerカーネルである [5].また, Mercerカーネルを用いるのであれば, 対応した双対問題は常に凹二次関数の最大化となり, 通常の二次計画問題の解法を用いれば大域的に最適化が可能である.
+
 カーネル関数の値<math>{ }_{i} { }_{j}\, </math>を<math>i-j\, </math>成分とする<math>M\, </math>次の対称行列を<math>K\, </math>とすれば, <math>K\, </math>が半正定値行列となるようなカーネル関数をMercerカーネル(あるいは半正定値カーネル)と呼び, このようなカーネル関数であれば,<math>{ }_{i}{ }_{j}=\phi({ }_{i})^{T}\phi({ }_{j})\, </math>となる特徴空間への変換<math>\phi(\cdot)\, </math>が存在することが保証される. 多項式カーネルやRBFカーネルはMercerカーネルである [5].また, Mercerカーネルを用いるのであれば, 対応した双対問題は常に凹二次関数の最大化となり, 通常の二次計画問題の解法を用いれば大域的に最適化が可能である.
  
 すなわち, 双対問題の最適解を<math>\alpha_{j}^{*}</math>とすれば, カーネル関数を用いた場合には, 次の非線形な判別関数が求められることとなる.
+
 すなわち, 双対問題の最適解を<math>\alpha_{j}^{*}\, </math>とすれば, カーネル関数を用いた場合には, 次の非線形な判別関数が求められることとなる.
  
  
<math>f(\Vx) = \sum_{j \in SV}\alpha_{j}^{*} y_{j}
+
:<math>f() = \sum_{j \in SV}\alpha_{j}^{*} y_{j}
                       \kernel{\Vx}{{ }_{j}} - b^{*}.
+
                       { }_{j} - b^{*}.\, </math>     <math>(6)\, </math>
</math>     <math>(6)</math>
 
  
  
 すなわち, 判別関数<math>f(\cdot)</math>は, サポート・ベクター <math>{ }_{j}\ (j \in SV)</math>に対応するカーネル関数<math>\kernel{\Vx}{{ }_{j}}</math>の重ね合せとして算出されると見ることができる.
+
 すなわち, 判別関数<math>f(\cdot)\, </math>は, サポート・ベクター <math>{ }_{j}\ (j \in SV)\, </math>に対応するカーネル関数<math>{ }_{j}\, </math>の重ね合せとして算出されると見ることができる.
  
  

2007年7月8日 (日) 00:27時点における版

【さぽーと・べくたー・ましん (support vector machine) 】

 サポート・ベクター・マシン (SVM) は, 判別関数を求める教師付き学習法のひとつである.

 今, 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle N\, } 個の属性を持ったデータが個与えられており,これを,構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle N\, } 次元空間構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \boldsymbol{R}^{N}\, } の点構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle { }_{1},{ }_{2},\ldots, { }_{M} \in \boldsymbol{R}^{N}\, } と考える. 各点構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle { }_{j}\ (j=1,2,\ldots,M)\, } は2種類のクラスのいづれか一方に属しており, 対応する2値のラベルが与えられているとする. このとき, ラベルの値にしたがって点を判別する2クラスの判別問題を考える.

 SVMでは線形関数を用いた判別を行う. 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle N\, } 次元の法線ベクトルおよび実数構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle b\,\, } で定まる線形関数を構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle f( ) = { }^{T} \ - b\, } とすれば, 与えられたデータおよびラベ:ルにしたがって,


構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle f({ }_{j}) = { }_{j}^{T}\ - b \left\{ \begin{array}{ll} > 0 & \mbox{if}\ \ y_{j} = 1,\\ < 0 & \mbox{if}\ \ y_{j} = -1, \end{array} \right.\quad j=1,2,\ldots,M \, }     構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle (1)\, }


となるベクトルとスカラ構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle b\, } を次に示す最適化問題を解くことで算出する.

 一般的には, 与えられた点全てに対して式 (1) を満たす構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \,b\, } が存在するとは限らないので, 非負の変数構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \xi_{j}\ (j=1,2,\ldots,M)\, } を導入し, 次の制約条件


構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \begin{array}{lll} {\displaystyle { }_{j}^{T} \ - b + \xi_{j} \geq 1 } & \mbox{if}& y_{j} = 1, \\ {\displaystyle { }_{j} \ - b - \xi_{j} \leq -1 } & \mbox{if}& y_{j} = -1 \end{array} \, }     構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle (2)\, }


のもと,構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \xi_{j}\, } の和とのノルムができるだけ小さくなる線形関数を考える. すなわち, 次の二次計画問題を解き構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \,b\, } を算出する [2].

    構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle (3)\, }
最大化
制約
構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \begin{array}{ll} &{ \textstyle \frac{1}{2}\| \| \frac{2}{2} + C \ {\sum}_{j=1}^{M} \xi_{j}}\\ &{ \textstyle { }_{j}^{T} \ - b + \xi_{j} \geq 1, \quad \mbox{if } y_{j} = 1,}\\ & { \textstyle { }_{j}^{T} \ - b - \xi_{j} \leq -1, \quad \mbox{if } y_{j} = -1,}\\ & { \textstyle \xi_{j} \ge 0, \quad j=1,2,\ldots,M} \end{array}\, }


ここで,構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle C\, } はあらかじめ設定された正の定数で, 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \textstyle \| \|\frac{2}{2}\, }構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \textstyle {\sum}_{j=1}^{M} \xi_{j}\, } とのバランスをコントロールするパラメータである. また, 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \textstyle \| \|\frac{2}{2}\, } は正則化項とも呼ばれ, これを小さくすることは判別関数に用いるデータの属性を少なくし, 過学習を防ぐ役割があるとされる [6]. 問題 (3) は, 1ノルムソフトマージンSVMと呼ばれる定式化である.

 通常は,この問題の双対問題を考え最適化を行う [5]. 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \alpha_{1},\alpha_{2},\ldots,\alpha_{M}\, } を双対変数とすれば, 問題 (3) の双対問題は

    構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle (4)\, }
最大化
制約
構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \begin{array}{ll} & { \textstyle - \frac{1}{2} \sum_{i=1}^{M}\sum_{j=1}^{M} y_{i}y_{j}{ }_{i}^{T}{ }_{j}\alpha_{i}\alpha_{j} + \sum_{j=1}^{M} \alpha_{j} }\\ & { \textstyle \sum_{j=1}^{M} y_{j} \alpha_{j}= 0, }\\ & { 0 \leq \alpha_{j} \leq C,\quad j=1,2,\ldots,M } \end{array}\, }


と書くことができ, これは1本の等式制約と各変数の上下限制約のみの凹二次関数の最大化となる. この特殊構造を用いた最適化アルゴリズム [3, 4] が知られており, データ数が数10万を超えるような大規模問題であっても, 高速に最適化が可能である.

 双対問題 (4) の最適解を構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \alpha^{*}_{1},\alpha^{*}_{2},\ldots,\alpha^{*}_{M}\, } とすれば,KKT条件より主問題 (3) の最適解構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle ^{*},b^{*}\, } とは, 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \textstyle ^{*} = \sum_{j=1}^{M} \alpha_{j}^{*} y_{j} { }_{j}\, } となる関係があり, さらに構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle 0<\alpha_{k}^{*}<C\, } となる添え字を構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle k\, } とすれば, 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle b^{*} = { }^{T}_{k} \ ^{*}-y_{k}\, } となることが示される. また, 特に添え字の集合構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle SV=\{j|\alpha_{j}^{*} \not = 0 \}\, } を定義すれば,に対応するデータ構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle { }_{j}\, } をサポート・ベクターと呼ぶ.したがって, 判別関数は双対問題の最適解とサポート・ベクターにより次のように表されることとなる.


構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle f( ) = { }^{T} \ ^{*} - b^{*} = \sum_{j \in SV} \alpha_{j}^{*} y_{j}^{T} { }_{j} - b^{*}\, }      構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle (5)\, }


さらに, 双対問題 (4) や主問題 (3) は, サポート・ベクター以外を全て取り除いても最適解は不変であり, これらの点はSVMでの判別にはまったく寄与していないことになる.

 SVMの最大の特徴は, 双対問題(4)を応用することで非線形な判別関数を構成できる点にある. 非線形な判別関数を構成するためには, まず, 適当な非線形変換構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \phi: \boldsymbol{R}^{N} \to {\mathcal F}\, } を使い各データ構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle { }_{j}\, } をより高い次元の特徴空間の元へと射影する. 射影された構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle {\mathcal F}\, } の元構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \phi({ }_{1}),\phi({ }_{2}),\ldots,\phi({ }_{M})\, } に対して, 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle {\mathcal F}\, } 上での線形な判別関数を求めれば, 元の空間で見れば非線形な判別関数を求めたこととなる.

 ここで, 双対問題 (4) に注目すれば,構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle {\mathcal F}\, } 上の内積構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \phi({ }_{i})^{T}\phi({ }_{j})\, } の値のみが得られれば定式化が可能であり, 特徴空間での点構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \phi({ }_{j})\, } の座標を必ずしも必要としないことが分かる. そこで, SVMではカーネル関数と呼ばれる特殊な関数構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle {\cdot}{\cdot}\, } を用い元のデータ構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle , ' \in \boldsymbol{R}^{N}\, } から直接の元構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \phi(),\phi(')\, } の内積構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \phi()^{T}\phi(')\, } を算出し, 双対問題の最適化により非線形の判別関数が求められる [1]. よく用いられる代表的なカーネル関数として, 多項式カーネル構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle ' = \left( { }^{T}\, ' + c \right)^{d}\,} やRBFカーネル , (ただし構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle d\, } は自然数のパラメータ, 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle c,\sigma\, } は実数のパラメータである) などがある.


 カーネル関数の値成分とする構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle M\, } 次の対称行列を構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle K\, } とすれば, 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle K\, } が半正定値行列となるようなカーネル関数をMercerカーネル(あるいは半正定値カーネル)と呼び, このようなカーネル関数であれば,構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle { }_{i}{ }_{j}=\phi({ }_{i})^{T}\phi({ }_{j})\, } となる特徴空間への変換構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \phi(\cdot)\, } が存在することが保証される. 多項式カーネルやRBFカーネルはMercerカーネルである [5].また, Mercerカーネルを用いるのであれば, 対応した双対問題は常に凹二次関数の最大化となり, 通常の二次計画問題の解法を用いれば大域的に最適化が可能である.

 すなわち, 双対問題の最適解を構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle \alpha_{j}^{*}\, } とすれば, カーネル関数を用いた場合には, 次の非線形な判別関数が求められることとなる.


構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle f() = \sum_{j \in SV}\alpha_{j}^{*} y_{j} { }_{j} - b^{*}.\, }      構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle (6)\, }


 すなわち, 判別関数構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle f(\cdot)\, } は, サポート・ベクター 構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle { }_{j}\ (j \in SV)\, } に対応するカーネル関数構文解析に失敗 (MathML、ただし動作しない場合はSVGかPNGで代替(最新ブラウザーや補助ツールに推奨): サーバー「https://en.wikipedia.org/api/rest_v1/」から無効な応答 ("Math extension cannot connect to Restbase."):): {\displaystyle { }_{j}\, } の重ね合せとして算出されると見ることができる.



参考文献

[1] B. E. Boser, I. M. Guyon, and V. N. Vapnik, "A training algorithm for optimal margin classifiers," in Proceedings of the fifth annual workshop on Computationa learning theory, USA, 144-152, 1992.

[2] C. Cortes and V. Vapnik, "Support-vector networks," Machine learning, 20 (1995), 273-297.

[3] T. Joachims, "Making large-scale support vector machine learning practical," in Advances in Kernel Methods, B. Schölkopf, C. Burges, and A. Smola, eds., The MIT Press, 169-184, 1999.

[4] J. C. Platt, "Fast training of support vector machines using sequential minimal optimization," in Advances in Kernel Methods, B. Schölkopf, C. Burges, and A. Smola, eds., The MIT Press, 185-208. 1999.

[5] J. Shawe-Taylor and N. Cristianini, Kernel Methods for Pattern Analysis, Cambridge University Press, 2004.

[6] V. N. Vapnik, The nature of statistical learning theory, Statistics for Engineering and Information Science, Springer-Verlag, 2000.