EML
本文最后更新于 2026年2月3日 晚上
Tree based model & ML
Definition of C
| 表头 | 一般理解 | 课上定义 |
|---|---|---|
| 定义 | C为Cost,Sum后为Penalty | C为Budget |
| 柿子形式 | +C | |
| 柿子对于Over和Underfitting的影响 | C小,总Penalty小,容易underfitting | Budget大,是Underfitting |
Bagging & Boosting
Bagging: Parallel
Boosting: Sequential
OOB的好处都有啥(
可以在不用validation set的情况下估算模型error。
Tree Pruning
降低variance,防止overfitting。
SVM
cost parameter C
C decrease, vector的margin变大,数量变多,underfitting。可见C的第一种定义
以及和support vector最相关的是在margin周围的data point。
Soft-margin
对于的data point,解读为misclassification。
Hyper plane
SV实际上是和相关data point距离之和最小的超平面。
对于hard-margin,只和margin周围的点有关。
对于soft-margin,和所有数据点有关
Kernel trick
- Using the kernel trick we can build non-linear SVM
- To train an SVM you only need the kernel matrix for the pairs of training points
- Any valid kernel function K(xi, xj) = <f(xi), f(xj)> in some (possibly infinite-dimensional) feature space.
- A kernel can’t be any symmetric function of its two arguments.
因为这个Kernel function必须是半正定的
半正定的定义:
有函数:
对任意点集和任意实数,都有
总结来说,就是由函数k生成的Gram矩阵必须是半正定的。
Gram矩阵就是每个向量两两内积生成的矩阵。
ML Model
如果一个模型的Activation function变为Linear的,那么这就是一个Linear model。
CNN的一个实现方法
CNN的一个操作是用一个小的filter去遍历整张图。
如何高效实现呢?观察乘后的矩阵,发现其实可以将图像展平为一个向量,然后构造一个总计算次数 X 向量长度的矩阵,然后拿展平的图去点积,每一行就是一次操作结果的扁平化。这样就可以快速便捷计算了。
EML
https://chenxizhou233.github.io/posts/b3adaaca.html