现在的位置: 首页 > 综合 > 正文

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

2017年12月25日 ⁄ 综合 ⁄ 共 1043字 ⁄ 字号 评论关闭
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的作用
     
























抱歉!评论已关闭.