References
- Book Reference: Understanding Machine Learning: From Theory to Algorithms, Shai Shalev-Shwartz and Shai Ben-David.
1. PAC Learning
Probably Approximately Correct (PAC) learning 是泛化理论中一个重要的概念, 用来刻画学习算法在有限样本下, 以高概率输出一个误差较小的 predictor 的能力. 这里的说明以 0-1 二分类问题为例, 不过 PAC learning 的概念可以推广到更一般的学习问题中.
Definition (PAC Learning)
给定一个 hypothesis class , 称之为 PAC learnable, 若:
存在一个固定的学习算法 (从样本到 hypothesis 的映射), 以及一个样本复杂度函数 (且要求 也是独立于后文的 和 )
使得对于任意的 (定义在输入空间 上的) 分布 , 任意 error tolerance level 及 confidence level , 对任意的 ground truth labeling function
只要 realizable assumption 成立, 且从 distribution 中 i.i.d. 采样得到的训练集 满足样本量 ,
Assumption (Realizability)
存在一个 hypothesis , 使得真实误差 . 换言之,
- 该假设说明 label 中没有不可解释的噪声, 也没有 misspecification.
就能够以概率至少 输出一个 hypothesis , 使得其真实误差 , 即
关于 PAC learning, 其本质上有两层嵌套的概率, 若全部显式表出, 则为:
上一个 Section中曾经推导过: 任意 finite hypothesis class 都是 PAC learnable 的, 且其样本复杂度为:
2. A More General Model
2.1 Agnostic PAC Learning
上述的 PAC learning 的定义是以 binary classification 为例的, 且假设 realizable assumption 成立. 然而这个假设往往是不成立的, 其可能包含如下误差:
- Irreducible error: 现实中或许并不存在一个 deterministic 的 ground truth labeling function , 也就是说即使给定完全的相同 feature , 其对应的 label 也可能是随机的.
- Misspecification error: 即使真的存在 ground truth labeling function , 但是它可能不在 hypothesis class 中.
当不再假设 realizable assumption, 需要对原先的概念进行扩展.
-
分布由原先的定义在 上的分布 和 ground truth labeling function 变为在 上的 joint distribution , 在样本上也是 i.i.d. 采样得到的训练集 .
-
此时的 true risk 变为:
-
此时, 无法再直接要求 , 因为 可能大于 0, 即当前的 hypothesis class 中最好的情况也可能无法达到 的误差要求. 故需要引入 agnostic PAC learning 的概念.
在正式讨论 agnostic PAC learning 之前, 先引入一个概念: Bayes optimal predictor.
Definition (Bayes Optimal Predictor)
(以 0-1 二分类问题为例) 给定一个 上的 joint distribution , 若一个可测函数 满足:
其中在 0-1 binary classification 中, 是 predictor 在 distribution 下的 true risk, 则称 为 Bayes optimal predictor.
- 这里强调, Bayes optimal predictor 是定义在 population 真实分布 上的, 而不是定义在训练集 上的. 此外, 这一 optimality 是针对某一个特定(但可以任意指定)的损失函数而言的, 例如这里是 0-1 loss, 也可以是其他的 loss function, 如 regression 中的 LSE, LAE 等.
- 一个反例, LASSO regression, 由于考虑了 regularizer, 即使是考虑 population level, 也通常不是 Bayesian optimal 的, 因为其相当于牺牲了一部分 bias 来换取 variance 的降低.
具体在 0-1 二分类问题中, Bayes optimal predictor 可以显式地表示为:
- 显然, 当已知 时, 若预测 , 则预测错误的概率为 , 若预测 , 则预测错误的概率为 . 因此, 为了最小化预测错误的概率, 应该选择 当且仅当 .
- 本质上, 0-1 loss 的 Bayes optimal predictor 是取条件众数.
Proposition (Bayes Optimality)
事实上, 对于任意的 predictor , Bayes optimal predictor 都是最优的, 即:
Proof
简记 , 则对于任意 predictor , 其 true risk 为:
现固定任意 .
对于任意 predictor , 其在 上的预测错误概率为:
- 若 , 则 .
- 若 , 则 .
因此对于给定的 , arbitrary predictor 的预测错误概率为 或 .
对于 Bayes optimal predictor,
- 当 时, , 此时预测错误概率为
- 当 时, , 此时预测错误概率为
相当于, Bayes optimal predictor 总是选择在 上预测错误概率较小的 label, 即
因此 pointwisely, 对于任意 , 都有
故对 , 取期望后, 有
Bayes optimal predictor 说明, 即使完全知道了整个数据的分布 , 在一般情况下也无法得到 0 的 true risk, 我们最小的 achievable true risk 是 , 这是一个 oracle benchmark, 往往也称之为 Bayes error.
不过在实作当中, Bayes error 也是一个过强的下界, 因此往往只要求算法能够达到给定 hypothesis class 中最小的 true risk, 即 , 故有层级关系:
- 如果 是一个非常丰富的 hypothesis class, 则 可能接近 , 反之则不然.
Definition (Agnostic PAC Learning)
给定一个 hypothesis class , 称之为 agnostic PAC learnable, 若:
- 存在一个固定的学习算法 , 一个样本复杂度函数
- 对任意定义在 上的 joint distribution , 及任意 ,
- 只要从 distribution 中 i.i.d. 采样得到的训练集 满足样本量 ,
- 就能够以概率至少 输出一个 hypothesis , 使得
说明:
- 由上可见, agnostic PAC learning 是对 PAC learning 的一个推广, 其控制的是输出结果与 内最优 predictor 的差距. 因此从学习的角度, 我们不再要求学习的效果是 arbitrarily small 的, 因为有可能本身 的表现就不够好.
- 此外, 上述定义中事实上并没有限制算法输出的 必须在 中, 也就是说算法可以输出一个不在 中的 hypothesis (称为 improper learning). 只不过一切的比较都是以 中最优的 predictor 为 benchmark.
2.2 The Scope of Learning Problems Modeled
事实上, PAC learning 和 agnostic PAC learning 的定义是非常 general 的, 其可以推广到更一般的学习问题中. 不一定是错误概率, 其可以是任意适当的 loss function, 甚至是不必要是 supervised learning 的问题.
抽象意义上, 给定 Hypothesis class , 以及某个 observation 集合 , 就可以定义一个 loss function .
- 在一般的 supervised learning 中, , 故 loss 可以定义为分类的 或 OLS 的
- 在 unsupervised learning 中也可以定义 loss. 例如, 在 k-means clustering 中, , 样本只有 feature , 而 loss function 可以定义为: 其中 是 k 个 cluster centers. 并且注意, 即使是对于 unsupervised learning, 我们也是可以讨论其泛化性能的: 在训练集上 cluster 很好的, 并不意味着在 population 上也能 cluster 得很好. 因此, 只要定义了 loss function, 就可以讨论泛化性能.
故在给定 后, 可以统一定义 true risk:
对应 empirical risk:
并且上述的 PAC learning 和 agnostic PAC learning 的定义也可以直接推广到更一般的 loss function 上.