吴恩达机器学习笔记3——单变量线性回归

第2章 单变量线性回归linear regression with one variable

1,模型描述 model representation

Supervised learning (given the 'right answer' for each example in the data):

regression problems(predict real-valued output)连续实数

classification problems(discrete-valued output)离散量

训练样本的表征

 

学习算法h的表征

以下是univariate linear regression 单变量线性回归

 

2,代价函数Cost function

如何把最有可能的直线与数据相拟合,平方误差代价函数,squared error cost function

 

3,代价函数(一)cost function intuition

找到使J最小的theta

4,代价函数(二)

采用等高线来看,在有两个变量theta0和theta1作用下,h_theta的值

5,梯度下降gradient descent

6,梯度下降知识点gradient descent intuition

随着theta_1接近最优点,他的导数值不断趋近于0,越来越小。

从而就算不调整alpha,梯度下降也会自动采用较小的步幅。

7,线性回归的梯度下降(Gradient descent for linear regression)

线性回归的梯度下降,代价函数相对于theta_0,theta_1是凸函数。

只有一个全局最优解,没有局部最优解,所以总是能得到最优解。

batch梯度下降法,需要计算所有的训练样本。也有不需要用到全部训练集的,后面会讲到。

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值