当前位置:网站首页>随着模型的复杂度增加,过拟合是怎么导致的?如何解决?
随着模型的复杂度增加,过拟合是怎么导致的?如何解决?
2022-08-07 11:00:00 【白羊by】
随着模型的复杂度增加,过拟合是怎么导致的?如何解决?
具体原因:
对于多项式曲线的拟合问题,我们定义模型如下所示(蓝色圆圈表示离散的样本点,绿色曲线为拟合样本点的多项式曲线)。

模型的定义十分重要,他会影响最后的拟合效果,其中M为超参数,M很小时,模型比较简单容易出现欠拟合的问题,而如果M很大又容易产生过拟合的问题。

当模型的超参数M选为9时(即多项式次数为9),则模型发生了过拟合,M取不同值时,求解得到经验风险最小化的结果如表所示,由表可以看出,随着M的增大W值疯狂增大,这是因为x取值在(0,1)之间,随着x的次数增大,只有x的系数过大才能对最终结果有一定的影响,例如当x=0.1,则x的9次方只有0.00000000001,所以x的系数为十亿时结果才为1.

解决方法:
随着M的增大,其多项式系数也变大,可以对大的多项式系数惩罚!
引入正则化项

在原有的经验风险的基础上引入正则化项,其中
为正则化系数。
用来控制对w惩罚的强弱,当等于
时,对W惩罚较大,W值变小只有72,并且曲线拟合较好。

当
等于
时几乎起不到惩罚作用,当
等于1时拟合曲线几乎为水平线,惩罚作用很大。

增加训练样本的数量
随着训练样本数量的增加,及时M为9模型较复杂,但是曲线拟合效果越来越好

边栏推荐
- The difference between delete commands in MySQL (delete, truncate, drop)
- 自定义推送铃声插件遇到的问题
- Flask框架——基于类的视图
- MySQL中删除命令的区别(delete、truncate、drop)
- Get all table names and table names with time strings in Mysql Use BetweenAnd to filter the interval range
- Niu Ke Duo School-Eezie and Pie- (multiplication + difference on the tree)
- The difference between structure definition struct and typedef struct (rearranged version)
- try、catch中finally和return执行顺序以及finally对变量操作对变量和结果的影响
- xlwings模块(数据保存为xlsx文件)
- CCNA-DHCP(动态主机配置协议)
猜你喜欢

亿纬锂能首件搭载自主研发46系列大圆柱电池系统产品成功下线

The problem that the uniapp local plugin list is empty

NProgress plugin (progress bar)

Redis只能做缓存?太out了!

GPT - 3 combination DALL e., 60 seconds to get the game set and original animation!After the net friend to see: want to play this game

产品“白送”+溢价入股,赛诺菲打响抄底中国生物科技资产第一枪

Million weft independent research and development of lithium can first pick up 46 rolled out series of large cylindrical battery system products

Problems encountered by the custom push ringtone plugin
状态存储 - Nanny State

unipush2.0教程
随机推荐
《bug记录》在利用TCP协议创建【服务器-客户端交互程序】中出现的一些问题
UGUI系列-屏幕自适应多分配率适配(Untiy3D)
Get all table names and table names with time strings in Mysql Use BetweenAnd to filter the interval range
UGUI series - the mouse moves to the button to display information (Unity3D)
Custom Annotations and Reflections
UGUI series-InputField limits the number of inputs and limits the input format
查询文件和目录的磁盘使用
如果想学一门语言,需要许多前趋知识点
解决Redis、MySQL缓存双写不一致问题
Niu Ke Duo School-Z-Game on grid- (Game Theory + Must-win and must-defeat transfer)
npm 发布问题
Unity packages webgl and deploys it to the local web server
介绍几个适用于matlab的colormap
对象内部的this指向问题
结构体定义struct和typedef struct的区别(重新整理版)
Problems encountered by the custom push ringtone plugin
The non-professional AI brother is on fire: he doesn't have an ML degree, but he got an offer from DeepMind
你知道12306 是如何支撑百万 QPS 的?
unity打包webgl 部署到本地Web服务器
百度智能云 | 全球首个!元宇宙安全极客大会来了