线性回归梯度下降 公式理解

 

解释:

gradient descent算法中(红框算法), x y轴对应的是 θ0 和 θ1 这两个不是常量是x,y轴!是hypothesiis函数里 两个变量 y=θ0 + θ1x   记住!记住!记住!

上面公式:  

        step1 选择一个点Point(θ0 =digit,θ1=另一个数 ) ,如下三维图

       然后不端 迭代更新 θ0和θ1的值

线性回归的梯度下降法 

=

在多属性中 ,比如房价由  size,location ,time,brand等综合决定

上图中 xi 表示,有某一行的样例数据,  m表示有m行的样例 

多元线性回归

让多元梯度回归下降的更快

1.让各属性值的范围再同一数量级 

two techniques to help with this are feature scaling and mean normalization. Feature scaling involves dividing the input values by the range (i.e. the maximum value minus the minimum value) of the input variable, resulting in a new range of just 1. Mean normalization involves subtracting the average value for an input variable from the values for that input variable resulting in a new average value for the input variable of just zero. To implement both of these techniques, adjust your input values as shown in this formula:

u1 是avg  s1是样本最大减最小

————对于线性回归 linear regression

想象一下 2元一次方程,在梯度gradient  为0时 ,函数值最小。

而在N feature 的回归样例中 ,同样思路 可以用 normal equation 去算出这个最小值时的 θ

    

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值