最小二乘法(LMS) 给定数据 \(D={(x^{(1)},y^{(1)}),(x^{(2)},y^{(2)}),...,(x^{(N)},y^{(N)})}\) , \(h_{\theta}(x)=\theta^T x=\theta_0x_0+\theta_1x_1+...+\theta_nx_n=\theta_0+\theta_1x_1+...+\theta_nx_n\) 给定 \(N\) 组数据: \[\theta_0+\theta_1x_1^{(1)}+\theta_2x_2^{(1)}+...+\theta_nx_n^{(1)}=y^{(1)}\] \[\theta_0+\theta_1x_1^{(2)}+\theta_2x_2^{(2)}+...+\theta_nx_n^{(2)}=y^{(2)}\\\vdots\] \[\theta_0+\theta_1x_1^{(N)}+\theta_2x_2^{(N)}+...+\theta_nx_n^{(N)}=y^{(N)}\] 求解 \(\theta\) ,使得输入 \(x\) ,得到 \(y\) 。求解线性方程组。 \(\Rightarrow A =\begin{matrix} 1&x_1^{(1)}&\dots &x_n^{(1)}\\1&x_2^{(1)}&\dots &x_n^{(2)}\\\vdots &