美文网首页
【机器学习】-Week3 11. Regularized log

【机器学习】-Week3 11. Regularized log

作者: Kitty_风花 | 来源:发表于2019-12-29 09:55 被阅读0次

Regularized Logistic Regression

We can regularize logistic regression in a similar way that we regularize linear regression. As a result, we can avoid overfitting. The following image shows how the regularized function, displayed by the pink line, is less likely to overfit than the non-regularized function represented by the blue line:

Cost Function

Recall that our cost function for logistic regression was:

We can regularize this equation by adding a term to the end:

The second sum,

means to explicitly exclude the bias term, θ0​. I.e. the θ vector is indexed from 0 to n (holding n+1 values, θ0​ through θn​), and this sum explicitly skips θ0​, by running from 1 to n, skipping 0. Thus, when computing the equation, we should continuously update the two following equations:

对比

线性回归 - 损失函数 正则化

逻辑回归 - 损失函数 正则化

线性回归 梯度下降

逻辑回归 梯度下降

来源:coursera 斯坦福 吴恩达 机器学习

相关文章

网友评论

      本文标题:【机器学习】-Week3 11. Regularized log

      本文链接:https://www.haomeiwen.com/subject/agsrectx.html