热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

三次多项式曲线php,PolynomialCurveFitting多项式曲线拟合(三)

Forthemoment,however,itisinstructivetocontinuewiththecurrentapproachandtoconsiderhowinprac

For the moment, however, it is instructive to continue with the current approach and to consider how in practice we can apply it to data sets of limited size where we may wish to use relatively complex and flexible models. One technique that is often used to control the over-fitting phenomenon in such cases is that of regularization, which involves adding a penalty term to the error function(1.2) in order  to discourage the coefficients from reaching large values. The simplest such penalty term takes the form of a sum of squares of all of the coefficients,leading to a modified error function of the form

此刻,我们要继续使用当前的方法,思考怎样将这个方法应用到有限的数据集,这里我们获取希望使用相对复杂或灵活的模型。一个经常使用的技术是正则化,它过去常常用来控制过拟合现象,这个技术会在错误函数中加一个惩罚因子,为了阻止系数达到最大值。最简单的惩罚因子就是所有系统的平方和的形式,修改后的错误函数如下:

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》

where ||w||2 ≡wTw = w2 0 +w2 1 +…+w2 M, and the coefficient λ governs the relative importance of the regularization term compared with the sum-of-squares error term. Note that often the coefficient w0 is omitted from the regularizer because its inclusion causes the results to depend on the choice of origin for the target variable (Hastie et al., 2001), or it may be included but with its own regularization coefficient (we shall discuss this topic in more detail in Section 5.5.1). Again, the error function in (1.4) can be minimized exactly in closed form. Techniques such as this are known Exercise 1.2 in the statistics literature as shrinkage methods because they reduce the value of the coefficients. The particular case of a quadratic regularizer is called ridge regression (Hoerl and Kennard, 1970). In the context of neural networks, this approach is known as weight decay.

其中

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》 = 

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》,系数

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》用来管理正则化因子相对于平方和错误因子的重要性。注意

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》常常会被从正则式中去掉,因为包含了它会导致依赖目标值的原点选择,或者包含一个属于它自己的正则化系数。还有,这个错误函数可以被精确的以闭合形式最小化。例如在练习1.2中统计学的收缩方法,因为他们减少了系数的值。一个二次正则式的特例是叫做边缘回归。在神经网络场景下,这种方法叫权重衰减。

Figure 1.7 shows the results of fitting the polynomial of order M =9 to the same data set as before but now using the regularized error function given by (1.4). We see that, for a value of lnλ = −18, the over-fitting has been suppressed and we now obtain a much closer representation of the underlying function sin(2πx). If, however, we use too large a value for λ then we again obtain a poor fit, as shown in Figure 1.7 for lnλ =0. The corresponding coefficients from the fitted polynomials are given in Table 1.2, showing that regularization has the desired effect of reducing the magnitude of the coefficients. The impact of the regularization term on the generalization error can be seen by plotting the value of the RMS error (1.3) for both training and test sets against lnλ, as shown in Figure 1.8. We see that in effect λ now controls the effective complexity of the model and hence determines the degree of over-fitting.

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》

图1.7展示了原来的阶为9,使用相同数据集,但现在使用正则化错误函数的拟合结果。我们看到对于ln

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》=-18,过拟合现象已经被抑制了,我们现在得到了一个更接近函数sin(2

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》x)的代表。但是如果我们使用太大的值,效果再次变差,如图1.7中ln

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》=0时的情况。如表1.2,给定了这个拟合多项式的相应的系数,显示正则化已经起到了减少系数权重的效果。正则化因子对于泛化的影响可以在RMS错误函数的对于训练数据和测试数据两种数据集的图像中看到,如图1.8.我们看到

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》现在控制了模型的有效复杂度,因此决定了过拟合的度。

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》

The issue of model complexity is an important one and will be discussed at length in Section1.3. Here we simply note that, if we were trying to solve a practical application using this approach of minimizing an error function, we would have to find a way to determine a suitable value for the model complexity. The results above suggest a simple way of achieving this, namely by taking the available data and partitioning it into a training set, used to determine the coefficients w, and a separate validation set, also called a hold-out set, used to optimize the model complexity (either M or λ). In many cases, however, this will prove to be too wasteful of valuable training data, and we have to seek more sophisticated approaches.

模型复杂度是一个重要的问题,我们会在1.3章节中讨论。在这里,我们就仅简单的知道,如果我们要使用这个最小化错误函数的方式解决实际应用,我们将不得不找到一种方式去决定模型复杂度的合适的值。上面的结果是一个简单的方法,将找一些可用的数据,将其分为训练集,用来决定系数,还有验证集,也叫做留出集合,用于优化模型复杂度(M或者

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》)。但是在许多场景下,这中方法浪费了有价值的训练数据。我们必须找到一种更巧妙的方法。

《三次多项式曲线php,Polynomial Curve Fitting 多项式曲线拟合(三)》

So far our discussion of polynomial curve fitting has appealed largely to intuition. We now seek a more principled approach to solving problems in pattern recognition by turning to a discussion of probability theory. As well as providing the foundation for nearly all of the subsequent developments in this book, it will also give us some important insights into the concepts we have introduced in the context of polynomial curve fitting and will allow us to extend these to more complex situations.

至此,我们对拟合曲线的讨论已经有了一个大的印象。我们现在寻找一种更原则性的方式去解决模式识别的问题,就是回到概率理论的讨论。它为这本书提供了所有后续开发的基础,也给我们一些重要的对于前面已经介绍过的曲线拟合概念的理解,也允许我们将这些扩展到更复杂的场景下。


推荐阅读
  • vue使用
    关键词: ... [详细]
  • 本文讨论了使用差分约束系统求解House Man跳跃问题的思路与方法。给定一组不同高度,要求从最低点跳跃到最高点,每次跳跃的距离不超过D,并且不能改变给定的顺序。通过建立差分约束系统,将问题转化为图的建立和查询距离的问题。文章详细介绍了建立约束条件的方法,并使用SPFA算法判环并输出结果。同时还讨论了建边方向和跳跃顺序的关系。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 展开全部下面的代码是创建一个立方体Thisexamplescreatesanddisplaysasimplebox.#Thefirstlineloadstheinit_disp ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • C++字符字符串处理及字符集编码方案
    本文介绍了C++中字符字符串处理的问题,并详细解释了字符集编码方案,包括UNICODE、Windows apps采用的UTF-16编码、ASCII、SBCS和DBCS编码方案。同时说明了ANSI C标准和Windows中的字符/字符串数据类型实现。文章还提到了在编译时需要定义UNICODE宏以支持unicode编码,否则将使用windows code page编译。最后,给出了相关的头文件和数据类型定义。 ... [详细]
  • 本文介绍了使用哈夫曼树实现文件压缩和解压的方法。首先对数据结构课程设计中的代码进行了分析,包括使用时间调用、常量定义和统计文件中各个字符时相关的结构体。然后讨论了哈夫曼树的实现原理和算法。最后介绍了文件压缩和解压的具体步骤,包括字符统计、构建哈夫曼树、生成编码表、编码和解码过程。通过实例演示了文件压缩和解压的效果。本文的内容对于理解哈夫曼树的实现原理和应用具有一定的参考价值。 ... [详细]
  • 微软头条实习生分享深度学习自学指南
    本文介绍了一位微软头条实习生自学深度学习的经验分享,包括学习资源推荐、重要基础知识的学习要点等。作者强调了学好Python和数学基础的重要性,并提供了一些建议。 ... [详细]
  • 本文介绍了brain的意思、读音、翻译、用法、发音、词组、同反义词等内容,以及脑新东方在线英语词典的相关信息。还包括了brain的词汇搭配、形容词和名词的用法,以及与brain相关的短语和词组。此外,还介绍了与brain相关的医学术语和智囊团等相关内容。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • IhaveconfiguredanactionforaremotenotificationwhenitarrivestomyiOsapp.Iwanttwodiff ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • 本文介绍了解决二叉树层序创建问题的方法。通过使用队列结构体和二叉树结构体,实现了入队和出队操作,并提供了判断队列是否为空的函数。详细介绍了解决该问题的步骤和流程。 ... [详细]
  • 3.223.28周学习总结中的贪心作业收获及困惑
    本文是对3.223.28周学习总结中的贪心作业进行总结,作者在解题过程中参考了他人的代码,但前提是要先理解题目并有解题思路。作者分享了自己在贪心作业中的收获,同时提到了一道让他困惑的题目,即input details部分引发的疑惑。 ... [详细]
author-avatar
志薇俊元4565
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有