東京大学 情報理工学系研究科 コンピュータ科学専攻 2015年8月実施 専門科目II 問題1
Author
祭音Myyura (co-authored with GPT 5.6 SOL)
Description
Consider the pattern recognition problem of classifying a d-dimensional real vectorial pattern x∈Rd into one of the two classes y=+1,−1. For training a classifier, suppose that n training samples
{(xi,yi)∣xi∈Rd, yi∈{+1,−1}, i=1,…,n}
are provided, where (xi,yi) means that the pattern xi belongs to the class yi.
Answer the following questions.
(1) Among the n training samples, let n+ and n− be the numbers of patterns in the classes +1 and −1, respectively. Find the mean vector c+ of the n+ patterns in the class +1, and the mean vector c− of the n− patterns in the class −1.
(2) Consider the classifier that assigns a sample x to the class +1 if ∥x−c+∥<∥x−c−∥, and to the class −1 if ∥x−c+∥>∥x−c−∥. Here ∥⋅∥ denotes the Euclidean norm. Give an equation for the boundary between: the region to which the patterns classified into the class +1 belong; and the region to which the patterns classified into the class −1 belong.
For a parameter w∈Rd, consider the linear classifier that assigns a sample x to the class +1 if wTx>0, and to the class −1 if wTx<0. Here (⋅)T denotes the transpose. Let us call the value yiwTxi the margin for the i-th training sample (xi,yi). Then the condition for this linear classifier to correctly classify the pattern xi into the class yi can be expressed, in terms of the margin, as yiwTxi>0.
Answer the following questions.
(3) When the linear classifier shown above does not correctly classify the pattern xi into the class yi, let us update the parameter w by
wnew=w+yixi.
Prove that this parameter update does not decrease the margin for the i-th training sample (xi,yi).
(5) When the linear classifier shown above does not correctly classify the pattern xi into the class yi, let us update the parameter w by
wnew=argminw′[∥w′−w∥2+(1−yiw′Txi)2].
Solve this optimization problem and obtain wnew explicitly.
题目描述
考虑把 d 维实向量 x∈Rd 分为 y=+1,−1 两类的模式识别问题。给定训练样本
{(xi,yi)∣xi∈Rd,yi∈{+1,−1},i=1,…,n}.
(1)设两类样本数为 n+,n−,求两类的均值向量 c+,c−。
(2)最近均值分类器在 ∥x−c+∥<∥x−c−∥ 时判为 +1,在 ∥x−c+∥>∥x−c−∥ 时判为 −1。其中 ∥⋅∥ 为欧几里得范数。求两类区域的边界方程。
线性分类器由 w∈Rd 给出:wTx>0 判为 +1,wTx<0 判为 −1。其中 (⋅)T 表示转置。样本 (xi,yi) 的间隔为 yiwTxi,正确分类的条件为 yiwTxi>0。
(3)样本 xi 未被正确分类时,令 wnew=w+yixi。证明该更新不会减小该样本的间隔。
(4)样本 xi 未被正确分类时,求下列优化问题的显式解:
wnew=argminw′[∥w′−w∥2+(1−yiw′Txi)2].
Kai
(1)
两类均值要求 n+>0 且 n−>0。
c+=n+1i:yi=+1∑xi,c−=n−1i:yi=−1∑xi.
(2)
两距离平方之差为
∥x−c−∥2−∥x−c+∥2=2(c+−c−)Tx+∥c−∥2−∥c+∥2.
当 c+=c− 时,边界超平面为
2(c+−c−)Tx=∥c+∥2−∥c−∥2.
左边大于右边的一侧判为 +1,小于的一侧判为 −1。若 c+=c−,则所有点到两均值的距离相等,题设的两个严格不等式均不成立,不能得到上述分类超平面。
(3)
更新后的间隔为
yiwnewTxi=yiwTxi+yi2∥xi∥2=yiwTxi+∥xi∥2.
因此间隔增加 ∥xi∥2≥0,不会减小。
(4)
目标函数严格凸。令其梯度为零,得到
w′−w=yixi(1−yiw′Txi).
记 mi=yiwTxi、ri=∥xi∥2。在上式左乘 yixiT 并整理,可得
1−yiw′Txi=1+ri1−mi.
所以唯一最优解为
wnew=w+1+∥xi∥21−yiwTxiyixi.