解释:
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 去算出这个最小值时的 θ