《机器学习》

发布时间:2026/7/20 21:18:25
《机器学习》 如有侵权或其他问题欢迎留言联系更正或删除。部分内容源自 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-processing13. 两个重要的模型性能评估方式bootstrap cross validation非常实用的技巧K折交叉验证用于数据不充足时14. Why is the training set loss sometimes low, but the test set loss high?There is anoverfittingproblem (过拟合) , and the models performance may be bad when its 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, biasTrue, deviceNone, dtypeNone)3. 线性回归 的 原理讲解已知train_xtrain_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-restC个分类器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 长度 的推导、目标函数及其优化条件③ 重点概念MarginMargin is defined as the width that the boundary could be increased by before hitting a data point.Support VectorThe 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 dont need to represent the mapping explicitly.Large Margin ClassifierBetter 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 subsetHierarchical Clustering– A set of nested clusters organized as a hierarchical tree.③ 如何实现 “Elbow finding”④ Fuzzy C-means⑤ Hierarchical Clustering层次聚类 How to Define Inter-Cluster SimilarityBy max, min, group average and the distance between centriods.层次聚类的优缺点优点无需预设聚类数可对应有意义分类。缺点合并不可撤销无直接目标函数对噪声敏感、难处理不同大小聚类等。层次聚类的两种方式凝聚法从各点为单独聚类开始逐步合并最近的聚类对直至剩 1 个或 k 个聚类。分裂法从包含所有点的单一聚类开始逐步分裂聚类直至每个聚类含 1 个点或 k 个聚类。神经网络① 感知机算法感知机算法例题② RBF 相关注意其中的 U、V 是人为设定的也即为题目将给出的已知条件③ 神经网络 相关感谢叶哥相关补充