Lecture2 Linear regression with one variable 单变量线性回归 2.1 模型表示 Model Representation 2.1.1 线性回归 Linear regression 2.1.2 单变量线性回归 Linear regression with one variable 2.2 代价函数 Cost Function 2.2.1 如何选择模型的参数 θ 2.2.2 建模误差 modeling error 2.2.3 平方误差代价函
文章内容均来自斯坦福大学的Andrew Ng教授讲解的Machine Learning课程,本文是针对该课程的个人学习笔记,如有疏漏,请以原课程所讲述内容为准.感谢博主Rachel Zhang的个人笔记,为我做个人学习笔记提供了很好的参考和榜样. § 1. 单变量线性回归 Linear Regression with One Variable 1. 代价函数Cost Function 在单变量线性回归中,已知有一个训练集有一些关于$x$.$y$的数据(如×所示),当我们的预测值$h(x)$
单变量线性回归(Linear Regression with One Variable)¶ In [54]: #初始化工作 import random import numpy as np import matplotlib.pyplot as plt # This is a bit of magic to make matplotlib figures appear inline in the notebook # rather than in a new window. %matplot