本文是学习Andrew Ng的机器学习系列教程的学习笔记。教学视频地址:
https://study.163.com/course/introduction.htm?courseId=1004570029#/courseDetail?tab=1
正则化来解决过拟合问题:
34. Regularization - the problem of overfitting
What’s overfitting?
过拟合就是我们的假设函数与样本一致,但是无法有效的预测新数据;
过拟合可以通过减少参数或者正则化方法来解决。
Overfitting 过拟合
Underfitting欠拟合
underfitting / high bias -> just right -> overfitting / high variance
deal with overfitting:
using figure:
or using other method:
35. Regularization - Cost function
通过在成本函数中引入正则化参数,给部分参数加很大的偏差惩罚,使得部分参数趋近于0;
Penalizing parameter by large value, make the feature to zero.
penalize 惩罚
prone 倾向
must choose a good value for regularization parameter lambda:
36. Regularization - Regularized linear regression
add regularized parameter for linear regression cost function:
over / times * minus – plus +
每次将参数降低一点点,1-α(λ/m)是比1小一点点的数。
通过正则化方法转变矩阵的可逆性,从而可以通过正规方程求解参数:
37. Regularization - Regularized logistic regression
逻辑回归的成本函数增加正则化因子:
梯度下降:
In octave how to do? In octave the indexing from one !