ml-2-1-多变量线性回归( Linear Regression with Multiple Variables)
多变量线性回归( Linear Regression with Multiple Variables)
多维特征
KaTeX parse error: No such environment: align* at position 8: \begin{̲a̲l̲i̲g̲n̲*̲}̲x_j^{(i)} &= \t…
h θ ( x ) = θ 0 + θ 1 x 1 + θ 2 x 2 + θ 3 x 3 + ⋯ + θ n x n h_\theta (x) = \theta_0 + \theta_1 x_1 + \theta_2 x_2 + \theta_3 x_3 + \cdots + \theta_n x_n hθ(x)=θ0+θ1x1+θ2x2+θ3x3+⋯+θnxn
KaTeX parse error: No such environment: align* at position 8: \begin{̲a̲l̲i̲g̲n̲*̲}̲h_\theta(x) =\b…
多变量梯度下降
与单变量线性回归类似,在多变量线性回归中,我们也构建一个代价函数,则这个代价
函数是所有建模误差的平方和
KaTeX parse error: No such environment: align* at position 8: \begin{̲a̲l̲i̲g̲n̲*̲}̲ & \text{repeat…
也可以这么表示
KaTeX parse error: No such environment: align* at position 8: \begin{̲a̲l̲i̲g̲n̲*̲}̲& \text{repeat …
梯度下降法实践 1- 特征缩放
x i : = x i − μ i s i x_i := \dfrac{x_i - \mu_i}{s_i} xi:=sixi−μi
梯度下降法实践 2- 学习率
特征和多项式回归
正规方程
θ = ( X T X ) − 1 X T y \theta = (X^T X)^{-1}X^T y θ=(XTX)−1XTy