Gradient Descent for Linear Regression,线性回归的梯度下降算法
2014-11-13 23:18
423 查看
内容均来自Standford公开课machine learning中Andrew老师的讲解.
针对线性回归模型,我们假设:hypothesis(x) = theta0 + theta1*x,(这里x是我们的样本值)
也就是上图的htheta(x),并且定义costFunction,就是上图的J(theta0,theta1),也就是要求theta0和theta1使得我们假设函数h(x)和样本真值(y)之间的平均误差最小,minJ(theta0,theta1)。
一开始我们可以指定theta0和theta1的初始值,然后采用梯度下降算法知道theta(j)收敛(这里i=0,1),也就是梯度下降不明显的时候。针对costFunction J(theta0,theta1)求偏导。
同时对theta0和theta1采用梯度下降算法,直到收敛,就可以找到合适的值。
为方便理解,这里又对常见的costFunction J(theta0,theta1)给出如下所示图:
也就是可以找到使得J(theta0,theta1)的theta0和theta1.
针对线性回归模型,我们假设:hypothesis(x) = theta0 + theta1*x,(这里x是我们的样本值)
也就是上图的htheta(x),并且定义costFunction,就是上图的J(theta0,theta1),也就是要求theta0和theta1使得我们假设函数h(x)和样本真值(y)之间的平均误差最小,minJ(theta0,theta1)。
一开始我们可以指定theta0和theta1的初始值,然后采用梯度下降算法知道theta(j)收敛(这里i=0,1),也就是梯度下降不明显的时候。针对costFunction J(theta0,theta1)求偏导。
同时对theta0和theta1采用梯度下降算法,直到收敛,就可以找到合适的值。
为方便理解,这里又对常见的costFunction J(theta0,theta1)给出如下所示图:
也就是可以找到使得J(theta0,theta1)的theta0和theta1.
相关文章推荐
- 线性回归与梯度下降(linear regression and gradient descent)
- 2 - 7 - Gradient Descent For Linear Regression (10 min)
- 线性回归、梯度下降(Linear Regression、Gradient Descent)
- 算法导论 Algorithms 01 - 线性回归 Simple linear regression
- Linear Regression (Gradient Descent & Normal Equation)
- 机器学习中的数学(1)-回归(regression)、梯度下降(gradient descent)
- 斯坦福机器学习视频笔记 Week1 线性回归和梯度下降 Linear Regression and Gradient Descent
- 机器学习中的数学(1)-回归(regression)、梯度下降(gradient descent)
- 关于LeftNotEasy《机器学习中的数学(1)-回归(regression)、梯度下降(gradient descent)》中的公式问题
- 机器学习中的数学(1)-回归(regression)、梯度下降(gradient descent)
- [置顶] 线性回归和梯度下降(Linear Regression and Gradient Descent)
- [blabla]a quick code about linear regression using gradient descent
- R语言--线性回归分析(1)--simple linear regression
- 线性回归正则化 regularized linear regression
- Locally Weighted Linear Regression 局部加权线性回归-R实现
- 多元线性回归multivariable linear regression
- 多变量线性回归中的批量梯度下降法(Batch Gradient Descent in Linear Regression with Multiple Variable)
- 回归(regression)、梯度下降(gradient descent)
- Locally weighted linear regression局部加权线性回归
- 机器学习中的数学(1)-回归(regression)、梯度下降(gradient descent)