如有侵权或其他问题,欢迎留言联系更正或删除。
部分内容源自 datawhale 开源教程及网络开源零散资料。侵删。
第一章 绪论
1. 机器学习 的 概念
研究关于 “学习算法” (一类能从数据中学习出其背后潜在规律的算法) 的一门学科。
PS:深度学习为“神经网络类”的学习算法,是机器学习的“子集”。
需深刻理解:更形式化的解释:已知 X 及 Y,求:f(X),即为:求 X 与 Y 间的映射关系;这使得计算机研究从 “方法驱动” 变为了 “数据驱动”。
2. 进阶学习资料
周志华老师的《机器学习理论导引》
3. 假设空间、版本空间 的 概念(需理解)
假设空间:假设能够拟合训练集的模型构成 的 集合
版本空间:所有能够拟合训练集的模型构成 的 集合
4. 算法、模型 的 概念
算法:从数据中习得 “模型/函数” 的具体方法
模型:“算法” 的产出结果
5. 样本、标记 的 概念
样本:样本对象 = 特征 + 标签
标记:标签
6. 大部分 神经网络 的 共同特征
1. 交替使用线性处理单元及非线性处理单元,被称为 “层”;
2. 使用链式法则(即:反向传播)更新网络的参数;
3. 基于通用近似定理:由包含非线性激活函数(如:Tanh、ReLU、Sigmoid激活函数)的隐藏层构成的前馈神经网络能够近似任何从一个有限维空间到另一个有限维空间的Borel可测函数。
换言之,在理想情况下,研究者们可以通过任意一个三层及三层以上的神经网络结构拟合并逼近现实生活中的大多数函数问题。
7. 从“表征学习”角度理解深度学习
“表征学习” 关注 “特征工程”;而 “深度学习” 是具有多级表示的表征学习方法(或:更复合的函数)
8. 如何理解:深度学习架构 的 结构越深,其 表征能力 越强?
eg. 线性决策边界 可通过组合获取 表征能力更强的非线性决策边界;而更深的网络结构,可利用非线性决策边界组合 获得 更复杂的非线性决策边界。
9. 如何理解:数据决定模型的上限,而更合适的算法将使模型更逼近该上限?
数据决定模型的上限:数据量(泛化性)、数据质量(特征工程);
更合适的算法将使模型更逼近该上限:模型不分高低贵贱,视具体情况而定,效果更好则更逼近真相。
10. 什么是 “独立同分布”(I.I.D.) ?
指:实验样本独立地从同一数据集采样获得;服从同一分布、且互不影响。
11. 如何理解 “无监督任务” 及 “有监督任务” ?
监督学习的目标是学习 “映射函数”:从输入特征至输出标签;无监督学习内模型通过分析数据间的关系以发现模式。目标是识别数据中的潜在结构,如:聚类、降维、异常检测。
12. 模式识别 相关:
Pattern Recognition is the study of how machines can observe the environment, learn to distinguish patterns of interest, and make reasonable decisions about categories of patterns.
模式识别过程包括以下 “阶段”:
data acquisition and sensing、pre-processing、feature extraction、model learning and estimation、classification、post-processing
13. 两个重要的模型性能评估方式:bootstrap & cross validation(非常实用的技巧,K折交叉验证,用于数据不充足时)
14. Why is the training set loss sometimes low, but the test set loss high?
There is anoverfittingproblem (过拟合) , and the model's performance may be bad when it's exposed to theunseensamples.
15. 各种学习策略:
Supervised Learning: Train models with labeled data to predict outputs for new inputs.
Semi-supervised Learning: Use a mix of labeled and unlabeled data to improve learning when labeled data is limited.
Unsupervised Learning: Discover patterns and structures in data without predefined labels.
Reinforcement Learning: Learn optimal actions in an environment through trial and error to maximize rewards.
第二章 基础模型汇总
贝叶斯模型
⑥ 通过 “最大化似然函数” 找到参数 "theta" 的估计值:
步骤 1:写出似然函数
步骤 2:取对数似然(Log-Likelihood)
步骤 3:对参数求导并令导数为 0
步骤 4:验证极大值(可选)
⑦ 贝叶斯损失函数 及 贝叶斯风险:
⑧ “最大似然估计” 相关的 “决策边界方程式” 求解:
⑨ 贝叶斯定理推导:
线性回归
1. 回归 及 分类 的区别
“分类” 输出值 “离散”,“回归” 输出值 “连续”;“分类” 本质目的是寻求类的分界面;“回归” 本质目的是寻求拟合函数;
(如:线性回归 — 回归,输出值连续;softmax 回归 — 分类,输出值离散)
2. 线性回归 的 简明实现(本质:最小二乘法)
# in_features & out_features:输入(出)特征形状;bias:偏置项(默认为True) torch.nn.Linear (in_features, out_features, bias=True, device=None, dtype=None)3. 线性回归 的 原理讲解
已知:train_x,train_y;寻求最优拟合函数所对应的最优参数:Y = F(X) = WX + b 中的 W 及 b;
使得损失值:Loss (F(train_x), train_y) 最低
4. 数学推导
4.1 一元 线性回归损失函数、目标函数(最小二乘法、极大似然估计,二者等价)
4.2 极大似然估计
具体实例:
更通俗的解释:首先已知数据值,假设其分布;然后求具备最大可能性的分布的参数
4.3 求解:一元 线性回归背景下的 argmin (w, b) E (w, b)
4.3.1 证明:argmin (w, b) E (w, b) 为关于 w 和 b 的 凸函数:
4.3.2 根据凸函数性质,求解:argmin (w, b) E (w, b):
线性分类
① 计算原点到判决边界的距离:
② 计算任意点到判决边界的距离:
③ 证明:
④ 重要题型:
⑤ 扩展到 “线性多分类” 场景:(C - 类别数)
两类方法:One-versus-the-rest(C个分类器,C次分类)、One-versus-one( (C-1)*C 个分类器)
⑥ 重点概念:
Linearly separable data: Dataset classes that can be precisely separated by a linear decision surface.
Decision surfaces: Boundaries defined by linear functions of input features, determining sample classes.
Decision regions: Areas in the input space divided by decision surfaces, each assigned to one class.
支持向量机
① 推导:任意点到 SVM 决策边界的距离:
② Margin 长度 的推导、目标函数及其优化条件:
③ 重点概念:
Margin:Margin is defined as the width that the boundary could be increased by before hitting a data point.
Support Vector:The data point closest to the hyperplane (超平面) is the support vector.
Kernel Trick:
① Mapping the data points into a higher dimension in order to make them linear seperable.
② Since only the dot product is used, we don't need to represent the mapping explicitly.
Large Margin Classifier:Better generalization ability & less over-fitting
决策树
① 决策树内的 Hunt 算法(贪心算法):
Let Dt be the set of training records which reaches the node t.
Hunt Algorithm: ① If Dt contains records that belong to the same class Yt, then t is a leaf node labeled as Yt. ② If Dt is an empty set, then t is a leaf node labeled by the default class Yd. ③ If Dt contains records that belong to more than one class, then use the attribute test to split the data into smaller subsets. Recrusively the procedure for all the subsets.
② 不纯度(impurity)衡量指标:
③ 重点例题:考察 GINI split:
聚类
① 聚类的目标:类间分离,类内聚集(Intra-cluster distances are minimized; Inter-cluster distances are maximized);
② 聚类的分类:
Partitional Clustering:
– A division of data objects into non-overlapping subsets (clusters) such that each data object is in exactly one subset;
Hierarchical Clustering:
– A set of nested clusters organized as a hierarchical tree.
③ 如何实现 “Elbow finding”:
④ Fuzzy C-means:
⑤ Hierarchical Clustering:
层次聚类 How to Define Inter-Cluster Similarity:By max, min, group average and the distance between centriods.
层次聚类的优缺点:
优点:无需预设聚类数,可对应有意义分类。
缺点:合并不可撤销,无直接目标函数,对噪声敏感、难处理不同大小聚类等。
层次聚类的两种方式:
凝聚法:从各点为单独聚类开始,逐步合并最近的聚类对,直至剩 1 个(或 k 个)聚类。
分裂法:从包含所有点的单一聚类开始,逐步分裂聚类,直至每个聚类含 1 个点(或 k 个)聚类。
神经网络
① 感知机算法:
感知机算法例题:
② RBF 相关:(注意:其中的 U、V 是人为设定的,也即为题目将给出的已知条件)
③ 神经网络 相关:(感谢叶哥)