更改

跳到导航 跳到搜索
添加22,395字节 、 2020年10月16日 (五) 20:00
创建页面,内容为“'''监督学习'''是一类[http://wiki.swarma.net/index.php/机器学习 机器学习]任务,该任务基于样例中的输入-输出对学得一个函数,从…”
'''监督学习'''是一类[http://wiki.swarma.net/index.php/机器学习 机器学习]任务,该任务基于样例中的输入-输出对学得一个函数,从而将一个(一般的)输入映射得到一个输出<ref name="a1">Stuart J. Russell, Peter Norvig (2010) Artificial Intelligence: A Modern Approach, Third Edition, Prentice Hall ISBN 9780136042594. </ref>。它从一组带标签的[https://en.wikipedia.org/wiki/Training,_test,_and_validation_sets 训练数据集]中推得函数<ref name="a2"> Mehryar Mohri, Afshin Rostamizadeh, Ameet Talwalkar (2012) Foundations of Machine Learning, The MIT Press ISBN 9780262018258</ref>。在监督学习中,每条样本包含一个输入对象(通常由向量表示)和一个输出值(也叫做标签)。监督学习算法分析训练集并产生一个推断函数,该函数能用于泛化新的样例。算法可以采用一个最优化方法来给出未见样例的正确类别。这要求学习算法以合理的方式将已知的训练数据集泛化到未知的情形(见[https://en.wikipedia.org/wiki/Inductive_bias ''归纳偏置''])。

在人类和动物心理学中,与监督学习对应的任务常被称为[https://en.wikipedia.org/wiki/Concept_learning 概念学习]。

==步骤==
为求解某个给定的监督学习问题,我们需要采取以下步骤:
#确定样本类型。在开始之前,使用者应决定何种类型的数据用作训练集。例如,在手写体识别中,训练数据可以是单个手写字符,一个手写体的词语,或整行手写文本。
#获取训练集。训练集应能代表使用该函数时面对的真实世界的情形,它包括一组输入对象以及相应的输出标签,通过人类专家采集或通过测量获取。
#确定假设函数的输入特征如何表示。预测函数的精度很大程度取决于输入对象如何表示。一般地,可将输入对象转化为一个[https://en.wikipedia.org/wiki/Feature_(machine_learning) 特征向量],该向量包含了一连串描述该对象的特征。特征的数量不宜过大,以免发生[https://en.wikipedia.org/wiki/Curse_of_dimensionality 维度灾难],但也应包含足够的信息以正确地预测输出。
#确定假设函数的结构以及相应的学习算法。例如,可以选用[http://wiki.swarma.net/index.php/SVM 支持向量机]或[http://wiki.swarma.net/index.php/决策树 决策树]算法。
#完成设计。在训练集上运行学习算法。部分监督学习算法要求使用者指定特定的控制参数。这些参数可根据在训练数据集的子集(称为校验集)上的优化效果做出调整,或通过[https://en.wikipedia.org/wiki/Cross-validation_(statistics) 交叉验证]进行调整。
#评估假设函数的精度。在学习和调参完成之后,所学得的函数应在测试集上使用并作出评估,测试集应不同于训练集。

==选择算法==
有很多种监督学习算法可供选用,这些算法各有其优势和缺陷。没有哪种算法能在所有监督学习问题中都取得最好的效果。(见无免费午餐定理)

选择算法时主要有四个方面需要考虑:

==='''偏差-方差权衡'''===
''词条见:''[https://en.wikipedia.org/wiki/Bias–variance_tradeoff ''偏差-方差权衡'']

第一个问题是偏差和方差的折中<ref name="a3">S. Geman, E. Bienenstock, and R. Doursat (1992). Neural networks and the bias/variance dilemma. Neural Computation 4, 1–58.</ref>。设想我们有若干个不同的高质量训练数据集。学习算法对某个特定输入x具有偏差是指,若在每个数据集上进行训练,在预测x的输出时总会产生与正确结果的系统性偏离。学习算法对某个特定输入x具有高方差是指,在不同的训练集上算法对x预测不同的输出值。一个分类器的预测误差取决于它偏差的总和以及方差。<ref name="a4">G. James (2003) Variance and Bias for General Loss Functions, Machine Learning 51, 115-135. (http://www-bcf.usc.edu/~gareth/research/bv.pdf) </ref>一般地,在偏差和方差之间存在着此消彼长。一个具有低偏差的学习算法必须足够“弹性”才能很好地拟合数据。但是如果算法太弹性了,它会在每个训练集上表现不同,因此引起高方差。许多监督学习方法的一个重要方面是,他们能调节偏差和方差之间的这种折中(要么自动调整,要么用户指定一个偏差/方差的控制参数)。

==='''函数复杂度和训练集数据量'''===
第二个问题是训练集的数据量之比于实际函数(分类或回归函数)的复杂度。如果实际函数简单,则一个具有高偏差和低方差的“非弹性”学习算法在少量数据上就能学得该函数。但如果实际函数高度复杂(例如多个不同输入特征间有相互作用,以及算法在不同输入空间上的行为不同),那么函数将只能通过在大量训练集上学习而得到,并且要使用具有低偏差和高方差的弹性学习算法。

==='''输入空间的维度'''===
第三个问题是输入空间的维度。如果输入特征向量具有很高维度,则即使目标函数仅由这些特征的一小部分决定,学习也将变得困难。这是因为其他“多余的”维度会扰乱学习算法并使之表现出高方差。因此,具有较高的输入维度时,一般要精调分类器到较低的方差和较高偏差。事实上,如果模型设计者能从输入数据中手动移除无关特征,则很有可能会提升学得的函数的精度。此外,很多算法会采用[https://en.wikipedia.org/wiki/Feature_selection 特征选择]来标记相关特征而丢弃无关特征。它是更一般的策略[https://en.wikipedia.org/wiki/Dimensionality_reduction 降维]的一个例子,降维是在运行监督学习算法前将输入数据映射到一个较低维的空间。

==='''输出中的噪声'''===
第四个问题是标注(监督的[https://en.wikipedia.org/wiki/Dependent_and_independent_variables#target_variable 标签变量])中的噪声度。如果标签有很多不正确(由于人为误差或传感器的采集误差),则算法不会学得一个准确匹配训练样本的函数。此时精细地匹配训练数据会导致[https://en.wikipedia.org/wiki/Overfitting 过拟合]。当所学函数对学习算法来说过于复杂时,即使在没有测量误差(随机噪声)时也会产生过拟合。在这种情况下,目标函数中不能被拟合的部分将对训练产生负面作用——这种现象被称为[https://en.wikipedia.org/wiki/Deterministic_noise 确定性噪声]。不论随机噪声还是确定噪声出现时,最好采用高偏差、低方差的学习器。

事实上,有几种方法可以减小输出值噪声的影响,例如训练时采用[https://en.wikipedia.org/wiki/Early_stopping 提前终止]策略防止[https://en.wikipedia.org/wiki/Overfitting 过拟合],或在训练前[https://en.wikipedia.org/wiki/Supervised_learning 检测]并移除噪声样例。
有几种算法能在训练之前标识噪声样例并移除可疑噪声样例,这些算法在[https://en.wikipedia.org/wiki/Statistical_significance 统计显著]性上降低了[https://en.wikipedia.org/wiki/Generalization_error 泛化误差].<ref name="a5">C.E. Brodely and M.A. Friedl (1999). Identifying and Eliminating Mislabeled Training Instances, Journal of Artificial Intelligence Research 11, 131-167. (http://jair.org/media/606/live-606-1803-jair.pdf) </ref><ref name="a6">M.R. Smith and T. Martinez (2011). "Improving Classification Accuracy by Identifying and Removing Instances that Should Be Misclassified". Proceedings of International Joint Conference on Neural Networks (IJCNN 2011). pp. 2690–2697. </ref>

==='''其它应考虑的(重要)因素'''===
选择和运用某个算法时,还应考虑如下因素:
*数据的多相性。如果特征向量包含多种不同的数据类型(离散型,离散有序型,可数型,数值型),采用某些算法将比其它算法更具有优势。许多算法,包括[http://wiki.swarma.net/index.php/SVM支持向量机 支持向量机]、[https://en.wikipedia.org/wiki/Linear_regression 线性回归]、[http://wiki.swarma.net/index.php/Logistic回归 逻辑斯谛回归]、[http://wiki.swarma.net/index.php/人工神经网络 神经网络]和[https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm 最近邻方法],都所有要求输入特征为数值类型并缩放到近似的区间内(如[-1,1]区间)。使用距离方法的函数,例如[https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm 最近邻方法]和[http://wiki.swarma.net/index.php/SVM支持向量机 高斯核支持向量机]对此尤其敏感。[http://wiki.swarma.net/index.php/决策树 决策树]算法的优点是可以方便地处理多相数据。

*数据的冗余性。若输入特征包含信息(例如存在高相关特征),一些算法将会由于数值不稳定而表现很差(如[https://en.wikipedia.org/wiki/Linear_regression 线性回归]、[http://wiki.swarma.net/index.php/Logistic回归 逻辑斯谛回归]和[https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm 基于距离的算法]).这类问题常通过引入某种形式的[https://en.wikipedia.org/wiki/Regularization_(mathematics) 正则]来解决。

*非线性的影响。如果每个特征对输出有独立地贡献,那么基于线性函数([https://en.wikipedia.org/wiki/Linear_regression 线性回归]、[http://wiki.swarma.net/index.php/Logistic回归 逻辑斯谛回归]、[http://wiki.swarma.net/index.php/SVM支持向量机 支持向量机]、)和距离函数的算法能够表现良好。然而,如果特征之间有复杂的相互作用,则类似于[http://wiki.swarma.net/index.php/决策树 决策树]和[http://wiki.swarma.net/index.php/人工神经网络 神经网络]的算法表现得更好,因为他们设计之初就旨在发现这些关系。线性方法也能使用,但设计者应在使用时手动处理这些复杂关系。

考虑新的应用问题时,工程师可以比较多种算法并由实验决定哪种算法在当前问题上表现最佳(见[https://en.wikipedia.org/wiki/Cross-validation_(statistics) 交叉验证]).精调某种算法的性能可能会很耗费时间。在给定资源的前提下,把时间花在搜集更多训练数据和相关特征上常常比精调算法效果要好。

==算法==
应用最广的学习算法如下:
*[http://wiki.swarma.net/index.php/SVM支持向量机 支持向量机]
*[https://en.wikipedia.org/wiki/Linear_regression 线性回归]
*[http://wiki.swarma.net/index.php/Logistic回归 逻辑斯谛回归]
*[http://wiki.swarma.net/index.php/贝叶斯分类 朴素贝叶斯]
*[http://wiki.swarma.net/index.php/线性判别分析 线性判别分析]
*[http://wiki.swarma.net/index.php/决策树 决策树]
*[https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm K近邻算法]
*[http://wiki.swarma.net/index.php/人工神经网络 神经网络(多层感知机)]

==监督学习算法原理==
给定一个包含N个训练样本的集合,形如<math>\{ (x_1,y_1),...,(x_N,y_N) \}</math>,其中<math>x_i
</math>是第i个样本的[https://en.wikipedia.org/wiki/Feature_vector 特征向量],<math>y_i</math>是其标签(即类别),学习算法寻找某个函数<math>g:X \rightarrow Y </math>,
<math>X</math>是输入空间,<math>Y</math>是输出空间。函数<math>g</math>是潜在函数空间<math>G</math>的一个元素,<math>G</math>常被称为''假设空间''。有时为使用方便,用打分函数
<math> f : X \times
Y \rightarrow \mathbb{R} </math>表示<math>g</math>,<math>g</math>定义为返回使打分函数取得最大值的<math>y</math>值:<math>g(x) = arg \underset{y}{} max f(x,y) </math>。令<math>F</math>表示得分函数的取值空间

尽管<math>G</math>和<math>F</math>可以是任意函数空间,但许多算法都是概率模型,其中<math>g</math>采用[https://en.wikipedia.org/wiki/Conditional_probability 条件概率]的形式<math>{g(x)=P(y|x)}</math>,或采用[https://en.wikipedia.org/wiki/Joint_probability_distribution 联合概率分布]模型<math>{f(x,y)=P(x,y)}</math>.例如,[http://wiki.swarma.net/index.php/贝叶斯分类 朴素贝叶斯]和[http://wiki.swarma.net/index.php/线性判别分析 线性判别分析]是联合概率分布模型,而[http://wiki.swarma.net/index.php/Logistic回归 逻辑斯谛回归]是条件概率模型。

有两种方法选择<math>f</math>或<math>g</math>:[https://en.wikipedia.org/wiki/Empirical_risk_minimization 经验风险最小化]或[https://en.wikipedia.org/wiki/Structural_risk_minimization 结构风险最小化].<ref>Vapnik, V. N. The Nature of Statistical Learning Theory (2nd Ed.), Springer Verlag, 2000. </ref>.经验风险最小化寻找能最好地拟合训练集的函数,结构风险最小化包含了权衡方差/偏差效应的''惩罚函数''。
在上述两种方法中,一般都假设训练集包含了[https://en.wikipedia.org/wiki/Independent_and_identically_distributed_random_variables 独立同分布]的样本对,<math>(x_i,y_i)</math>.为了度量函数适应训练数据的好坏,定义[https://en.wikipedia.org/wiki/Loss_function 损失函数]<math>L:Y \times Y \rightarrow \mathbb{R}^{{\geq} 0}</math>.对于训练样本<math>(x_i,y_i)</math>,预测值<math>\hat{y}</math>的损失为<math>L(y_i,\hat{y})</math>.函数<math>g</math>的''风险''定义为<math>g</math>的期望损失。期望损失可以由训练数据进行估计

<math>R_{emp}(g)=\frac{1}{N}\sum_{i}{L(y_i,g(x_i))}</math>.

==='''经验风险最小化'''===
''词条见:''[https://en.wikipedia.org/wiki/Empirical_risk_minimization ''经验风险最小化'']
在经验风险最小化方法中,监督学习算法求得一个函数<math>g</math>,使<math>R(g)</math>最小化。因此监督学习算法可以通过应用最优化方法寻找<math>g</math>而实现。若<math>g</math>是条件概率分布<math>P(y|x)</math>,损失函数是负对数似然:<math> L(y,\hat{y}) = -logP(y|x)</math>,则经验风险最小化等价于[https://en.wikipedia.org/wiki/Maximum_likelihood_estimation 极大似然估计].如果G包含很多候选函数,或训练集不足够大,经验风险最小化会导致高方差和不良的泛化。学习算法只记住了训练样例而没有很好地泛化,这被称为[https://en.wikipedia.org/wiki/Overfitting 过拟合].

==='''结构风险最小化'''===
[https://en.wikipedia.org/wiki/Structural_risk_minimization 结构风险最小化]通过向优化表达式中引入[https://en.wikipedia.org/wiki/Regularization_(mathematics) 正则惩罚项]防止过拟合。正则惩罚项可以看做[https://en.wikipedia.org/wiki/Occam%27s_razor 奥卡姆剃刀]的一种实现方式,即选择更简单而非更负杂的函数。

对于不同的复杂度定义,采用的惩罚项也各不相同。例如,考虑函数<math>g</math>是线性函数时的情形<math>g(x) = \sum_{j=1}^d\beta_jx_j</math>
此时常用的正则惩罚项是<math>\sum_j\beta_j^2</math>,即权重平方[https://en.wikipedia.org/wiki/Norm_(mathematics)#Euclidean_norm 欧氏范数],也称为<math>L_2</math>范数。其他范数包括<math>L_1</math>范数,<math>\sum_j|\beta_j|</math>,以及<math>L_0</math>范数,<math>L_0</math>是指非零参数<math>\beta_j</math>的个数,惩罚项用符号<math>C(g)</math>表示.
于是监督学习优化问题可归结为找到函数<math>g</math>,使得<math>J(g) = R_{emp}(g) + \lambda C(g)</math>取得最小值。

参数<math>\lambda</math>控制偏差方差比重。当<math>\lambda = 0</math>时,得到的是低偏差高方差的经验风险最小化表达式,当<math>\lambda</math>很大时,学习算法具有高偏差和低方差。<math>\lambda</math>的值可以通过[https://en.wikipedia.org/wiki/Cross-validation_(statistics) 交叉验证]经验地选取。

复杂度惩罚项在贝叶斯中的解释是<math>g</math>的负对数先验概率,<math>-logP(g)</math>,而<math>J(g)</math>是<math>g</math>的后验概率。

==生成式训练==
以上描述的训练方法均为''判别式训练''方法,因为他们都寻求一个函数<math>g</math>,使得函数能很好地判别不同输出值(见[https://en.wikipedia.org/wiki/Discriminative_model 判别式模型]).在<math> {f(x,y)=P(x,y)} </math>为联合概率分布且损失函数为负对数似然<math>\sum_ilogP(x_i,y_i)</math>的情况下,风险最小化算法也称做''生成式训练'',因为<math>f</math>可被看作是解释数据如何生成的[https://en.wikipedia.org/wiki/Generative_model 生成模型]。与判别式训练算法相比,生成式训练算法常常更为简单,且有更高的计算效率。在某些情况下求解可用闭式解的形式计算,就像[http://wiki.swarma.net/index.php/贝叶斯分类 朴素贝叶斯]和[http://wiki.swarma.net/index.php/线性判别分析 线性判别分析]中的那样。

==扩展==
标准监督学习问题可通过以下几种方法来扩展:
*[https://en.wikipedia.org/wiki/Semi-supervised_learning 半监督学习]:在这种情况下,只有一部分训练数据具有给定的输出值(标签),而其他的没有标签。
*[https://en.wikipedia.org/wiki/Active_learning_(machine_learning) 主动学习]:与假定一开始给出所有训练数据不同,主动学习在交互中获得新样本,一般通过询问人类用户来实现。询问常常基于无标签的数据,这种场景下半监督学习和主动学习结合了起来。
*[https://en.wikipedia.org/wiki/Structured_prediction 结构化预测]:当想要的输出值是一个复杂对象,如解析树或带标签的图时,要对标准方法进行扩展。
*[https://en.wikipedia.org/wiki/Learning_to_rank 排序学习]:当输入是一组对象的集合,而输出是这些对象的排序,那么这种学习任务也要对标准方法进行扩展。

==方法和算法==

*[https://en.wikipedia.org/wiki/Analytical_learning 分析学习]
*[http://wiki.swarma.net/index.php/人工神经网络 人工神经网络]
*[https://en.wikipedia.org/wiki/Backpropagation 反向传播]
*[https://en.wikipedia.org/wiki/Boosting_(machine_learning) 提升方法]
*[https://en.wikipedia.org/wiki/Bayesian_statistics 贝叶斯统计]
*[https://en.wikipedia.org/wiki/Case-based_reasoning 基于案例推理]
*[http://wiki.swarma.net/index.php/决策树 决策树]
*[https://en.wikipedia.org/wiki/Inductive_logic_programming 归纳逻辑编程]
*[https://en.wikipedia.org/wiki/Kriging 高斯过程回归]
*[https://en.wikipedia.org/wiki/Genetic_programming 遗传规划]
*[https://en.wikipedia.org/wiki/Group_method_of_data_handling 数据成组处理法]*
*[https://en.wikipedia.org/wiki/Variable_kernel_density_estimation#Use_for_statistical_classification 核估计]
*[https://en.wikipedia.org/wiki/Learning_automaton 学习自动机]
*[https://en.wikipedia.org/wiki/Learning_classifier_system 学习分类器]
*[https://en.wikipedia.org/wiki/Minimum_message_length 最小信息长度]([https://en.wikipedia.org/wiki/Decision_tree 决策树],决策图等)
*[https://en.wikipedia.org/wiki/Multilinear_subspace_learning 多线性子空间学习]
*[http://wiki.swarma.net/index.php/贝叶斯分类 朴素贝叶斯分类器]
*[https://en.wikipedia.org/wiki/Multinomial_logistic_regression 最大熵分类器]
*[http://wiki.swarma.net/index.php/条件随机场 条件随机场]
*[https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm k近邻算法]
*[https://en.wikipedia.org/wiki/Probably_approximately_correct_learning PAC-learning]
*[https://en.wikipedia.org/wiki/Ripple-down_rules Ripple-down rules],一种知识获得方法论
*[https://en.wikipedia.org/wiki/Symbolic_machine_learning 符号机器学习]算法
*[https://en.wikipedia.org/wiki/Subsymbolic_machine_learning 次生符号机器学习]算法
*[http://wiki.swarma.net/index.php/SVM支持向量机 支持向量机]
*最小复杂度机器
*[https://en.wikipedia.org/wiki/Random_forest 随机森林]
*[https://en.wikipedia.org/wiki/Ensemble_learning 集成学习]
*[https://en.wikipedia.org/wiki/Level_of_measurement#Ordinal_scale 序级分类]
*[https://en.wikipedia.org/wiki/Data_pre-processing 数据预处理]
*[https://en.wikipedia.org/wiki/Handling_imbalanced_datasets 不平衡集处理]
*[https://en.wikipedia.org/wiki/Statistical_relational_learning Statistical relational learning]
*[https://en.wikipedia.org/wiki/Proaftn 模糊分类方法]

==应用==

*[https://en.wikipedia.org/wiki/Bioinformatics 生物信息学]
*[https://en.wikipedia.org/wiki/Cheminformatics 化学信息学]
:*[https://en.wikipedia.org/wiki/Quantitative_structure–activity_relationship 定量结构活性关系]
*[https://en.wikipedia.org/wiki/Database_marketing 数据库营销]
*[https://en.wikipedia.org/wiki/Handwriting_recognition 手写体识别]
*[https://en.wikipedia.org/wiki/Information_retrieval 信息检索]
:*[https://en.wikipedia.org/wiki/Learning_to_rank 排序学习]
*[https://en.wikipedia.org/wiki/Information_extraction 信息提取]
*[https://en.wikipedia.org/wiki/Computer_vision 计算机视觉]中的目标识别
*[https://en.wikipedia.org/wiki/Optical_character_recognition 光学字符识别]
*[https://en.wikipedia.org/wiki/Spamming 垃圾邮件检测]
*[https://en.wikipedia.org/wiki/Pattern_recognition 模式识别]
*[https://en.wikipedia.org/wiki/Speech_recognition 语音识别]
*监督学习在生物系统中是[https://en.wikipedia.org/wiki/Downward_causation 下向因果关系]的一个特例

==相关扩展==

*[https://en.wikipedia.org/wiki/Computational_learning_theory 计算学习理论]
*[https://en.wikipedia.org/wiki/Inductive_bias 归纳偏置]
*[https://en.wikipedia.org/wiki/Overfitting 过拟合]
*[https://en.wikipedia.org/wiki/Probabilistic_classification 概率化分类]
*[https://en.wikipedia.org/wiki/Unsupervised_learning 无监督学习]
*[https://en.wikipedia.org/wiki/Version_space_learning verison space learning]


==参见==

*[https://en.wikipedia.org/wiki/List_of_datasets_for_machine_learning_research 机器学习数据集列表]

==参考文献==
<references/>

==外部链接==
*[https://mloss.org/software/ 机器学习开源软件]


[[Category:机器学习]]
[[category:旧词条迁移]]
113

个编辑

导航菜单