京都大学 情報学研究科 知能情報学専攻 2024年8月実施 専門科目 S-2
Author
itsuitsuki
Description
We consider a problem of classifying a three-dimensional vector, where a value of each element is either 0 or 1, into either the class 1 or the class 2. Let x=(x(1),x(2),x(3))∈{0,1}3 be a vector. Assume that each element of x of the class y=k (k∈{1,2}) independently follows a Bernoulli distribution, and let p(x(j)=1∣y=k)=μ(k)(j) (0≤μ(k)(j)≤1, j∈{1,2,3}) be the probability of x(j)=1. Let μ(k)=(μ(k)(1),μ(k)(2),μ(k)(3)) be parameters of the class k.
Let D={(x1,y1),(x2,y2),…,(xN,yN)} be a data set consisting of N data. Let xi=(xi(1),xi(2),xi(3)) be the vector of the i-th data, and yi be the class of xi. We assume that xi (i∈{1,…,n}) of the class yi=k is independently observed from the aforementioned distribution whose parameter is μ(k).
(1) Let p(y=k) be a prior probability for the class k. We determine an estimated class y^ of x by comparing the posterior probabilities. Namely, we set y^=1 if p(y=1∣x)≥p(y=2∣x); otherwise we set y^=2. Show a rule that assigns x to an estimated class y^ by using p(y=k) and μ(k)(j).
(2) Let D(k)={(xi,yi)∈D∣yi=k} (k∈{1,2}) be a subset of the data set D. By using D(k), derive the maximum likelihood estimate μ^(k) of μ(k) from the data set D.
(3) Assume that a data set D is given in Table 1. Compute the values of the maximum likelihood estimates μ^(k) (k∈{1,2}) from Table 1.
Table 1: A data set
| i | xi | yi |
|---|
| 1 | (1,0,0) | 1 |
| 2 | (1,0,1) | 1 |
| 3 | (1,1,0) | 2 |
| 4 | (0,1,0) | 1 |
| 5 | (0,0,1) | 2 |
(4) Let prior probabilities be p(y=1)=53 and p(y=2)=52. Compute the estimated class y^ of x=(1,1,1) by substituting μ^(k) computed in (3) for μ(k) of the rule shown in (1).
(5) Let a prior probability p(y=1) be q (0≤q≤1). We classify x=(1,1,1) by substituting μ^(k) computed in (3) for μ(k) of the rule shown in (1). Explain the relation between q and an estimated class y^.
题目描述
考虑把三维二元向量 x=(x(1),x(2),x(3)) 分类到类别 y∈{1,2} 的问题。给定类别 k 时,各分量相互独立且服从 Bernoulli 分布:
p(x(j)=1∣y=k)=μj(k),j=1,2,3.
现有数据集 D={(xi,yi)},回答下列问题。
-
使用类别先验概率以及参数 μ(k),推导比较后验概率的分类规则;若两个类别的后验概率相同,则规定分类为类别 1。
-
对每一个类别的样本子集,推导各参数 μj(k) 的最大似然估计量。
-
对下表数据计算两个类别的参数估计 μ^(1) 与 μ^(2),并计算第(1)问所需的分类规则:
| i | xi | yi |
|---|
| 1 | (1,0,0) | 1 |
| 2 | (1,0,1) | 1 |
| 3 | (1,1,0) | 2 |
| 4 | (0,1,0) | 1 |
| 5 | (0,0,1) | 2 |
-
令先验概率 p(y=1)=53、p(y=2)=52,把第(3)问求得的参数估计代入第(1)问的规则,求 x=(1,1,1) 的预测类别 y^。
-
改令 p(y=1)=q,其中 0≤q≤1。仍使用第(3)问的参数估计对 x=(1,1,1) 分类,说明 q 与预测类别 y^ 之间的关系。
- Bernoulli 朴素贝叶斯分类:由条件独立假设分解类条件似然,并结合先验概率比较后验概率。
- Bernoulli 参数的最大似然估计:按类别统计每个二元特征取 1 的频率。
- 先验敏感性与零概率现象:代入稀疏样本估计,分析分类结论随类别先验变化的分段关系。