Felomeng翻译:libsvm2.88之预先计算好的内核

<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span style="">用户可以预告计算好核心数值并将它们作为训练和测试文件输入。这样支持向量机工具包就不需要原始的训练</span><span style=""><span style="font-family: Times New Roman;">/</span></span><span style="">测试数据集了。</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span style="">假设有</span><span style=""><span style="font-family: Times New Roman;">L</span></span><span style="">个训练实例,</span><span style=""><span style="font-family: Times New Roman;">x1,…,xL</span></span><span style="">。设</span><span style=""><span style="font-family: Times New Roman;">K(x,y)</span></span><span style="">为实例</span><span style=""><span style="font-family: Times New Roman;">x</span></span><span style="">与</span><span style=""><span style="font-family: Times New Roman;">y</span></span><span style="">的内核值。则输入数据格式为:</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span style=""><span style="font-family: Times New Roman;">xi</span></span><span style="">的新训练实例:</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style=""><span style="font-size: small; font-family: Times New Roman;">&lt;label&gt;0:I 1:K(xi,x1)…L:K(xi,xL)</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span style=""><span style="font-family: Times New Roman;">x</span></span><span style="">的新测试实例:</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style=""><span style="font-size: small; font-family: Times New Roman;">&lt;label&gt;0:?1:K(x,x1)…L:K(x,xL)</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span style="">也就是说,在训练文件中,第一列必须是</span><span style=""><span style="font-family: Times New Roman;">xi</span></span><span style="">的“</span><span style=""><span style="font-family: Times New Roman;">ID</span></span><span style="">”。在测试实例中,</span><span style=""><span style="font-family: Times New Roman;">?</span></span><span style="">表示任意值。</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span style="">包括“</span><span style=""><span style="font-family: Times New Roman;">±0</span></span><span style="">”在内的所有内核数值都必须明确给定。训练</span><span style=""><span style="font-family: Times New Roman;">/</span></span><span style="">测试文件的任何排列或随机子集都是合法的(见下面的例子)。</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style=""><span style="font-size: small;">注意:与支持向量机工具包的早期发行版本中工具的预先计算好核心集的格式略有不同</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style=""><span style="font-size: small;">示例:</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span lang="EN-US"><span style=""><span style="font-family: Times New Roman;"> </span></span></span><span style="">假设原始训练数据有三个实例,每个实例有四种属性,而测试数据有一个实例:</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style=""> </span>15<span style=""> </span>1:1 2:1 3:1 4:1</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style=""> </span>45<span style=""> </span>2:3<span style=""> </span>4:3</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style=""> </span>25<span style=""> </span>3:1</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style=""> </span>15<span style=""> </span>1:1<span style=""> </span>3:1</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span lang="EN-US"><span style=""><span style="font-family: Times New Roman;"> </span></span></span><span style="">如果使用线性核心,那么我们会得到如下的训练与测试集合:</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style=""> </span>15<span style=""> </span>0:1 1:4 2:6<span style=""> </span>3:1</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style=""> </span>45<span style=""> </span>0:2 1:6 2:18 3:0 </span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style=""> </span>25<span style=""> </span>0:3 1:1 2:0<span style=""> </span>3:1</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style=""><span style="font-size: small; font-family: Times New Roman;"></span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style=""> </span>15<span style=""> </span>0:? 1:2 2:0<span style=""> </span>3:1</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Times New Roman;"><span style=""> </span>? </span></span><span style="">表示任意值</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span lang="EN-US"><span style=""><span style="font-family: Times New Roman;"> </span></span></span><span style="">以上训练文件中的任意子集也都是合法的。例如:</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style=""> </span>25<span style=""> </span>0:3 1:1 2:0<span style=""> </span>3:1</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style=""> </span>45<span style=""> </span>0:2 1:6 2:18 3:0 </span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Times New Roman;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span lang="EN-US"><span style=""><span style="font-family: Times New Roman;"> </span></span></span><span style="">意味着核心矩阵是</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span lang="EN-US"><span style=""> </span></span><span style="">[K(2,2) K(2,3)] = [18 0]</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span lang="EN-US"><span style=""> </span></span><span style="">[K(3,2) K(3,3)] = [0<span style=""> </span>1]</span></span></span></p>

你可能感兴趣的:(lib)