斯坦福机器学习-week 3 学习笔记(3)—— 解决Overfitting

keyword: Overfitting ,Regularization


目录
一.Overfitting的定义
二.解决Overfitting的方法
三.Regularization
四.Regularization时α值的影响

 


一.Overfitting的定义
    根据Andrew Ng的说法,overfitting的定义如下:If we have too many features,the learnde hypothesis may fit the training set very well,but fail to generalize to new examples.
    也就是说,Overfitting(过拟合)是指,对于训练样本的分类正确率很高,然而,对于测试集而言,会出现分类正确率很低的情况。



二.解决Overfitting的方法





三.Regularization
    根据维基百科,In statistics and machine learning, regularization methods are used for model selection, in particular to prevent overfitting by penalizing models with extreme parameter values. The most common variants in machine learning are L₁ and L₂ regularization, which can be added to learning algorithms that minimize a loss function E(X, Y) by instead minimizing E(X, Y) + α‖w‖, where w is the model's weight vector, ‖·‖ is either the L₁ norm or the squared L₂ norm, and α is a hyperparameter tuned by cross-validation.


    也就是说,为了避免overfitting,在cost function中添加一项,可以将J(θ)转化为下面的形式
    


    进行了Regularization以后,合适的α值可以减少模型中那些比较复杂的部分的参数过大,从而减少模型出现Overfitting的可能。



四.Regularization时α值的影响
    合适的α值,能够减少Overfitting;
    较大的α值,能够产生underfitting;
    较小的α值,不能起到消除Overfitting的作用
     

























  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值