Chapter02.Linear regression with one variable 线性回归算法(Machine Learning)
提示
提示:
文章目录
- Chapter02.Linear regression with one variable 线性回归算法(Machine Learning)
- 2.1 Model Representation 模型描述
- 2.2 Cost Function 代价函数
- 2.3 Cost Function intuition I
- 2.4 Cost Function - Intuition II
- 2.5 Gradient Descent 梯度下降
- 2.6 Gradient Descent intuition 梯度下降知识点
- 2.7 Gradient Descent For Linear Regression 线性回归的梯度下降
2.1 Model Representation 模型描述
房价预测
Supervised Learning: Given the “right answer” for each example in the data.
每个例子都有一个正确的答案。
Regression Problem: Predict real-valued out put
可以预测一个具体的数值输出
Classification:Predict discrete-valued outputs
可以预测一个离散输出
The meaning of the letter
m: 训练样本数量
x’s: 输入变量/特征
y’s: 输出变量/目标变量
(x, y): 一个训练样本
(x(i),x(i)): 第ith 个训练样本,索引
x(i) to denote the “input” variables (living area in this example), also called input features
y(i) to denote the “output” or target variable that we are trying to predict (price).
(x(i), y(i)) is called a training example, and the dataset that we’ll be using to learn—a list of m training examples
(x(i), y(i)); i = 1, . . . , m is called a training set.
Note that the superscript “(i)” in the notation is simply an index into the training set, and has nothing to do with exponentiation.
X to denote the space of input values, and
Y to denote the space of output values.
In this example, X = Y = ℝ
To describe the supervised learning problem slightly more formally, our goal is, given a training set, to learn a function h : X → Y so that h(x) is a “good” predictor for the corresponding value of y.
For historical reasons, this function h is called a hypothesis.
Seen pictorially, the process is therefore like this:
假设函数
- When the target variable that we’re trying to predict is continuous, such as in our housing example, we call the learning problem a regression problem.
- When y can take on only a small number of discrete values (such as if, given the living area, we wanted to predict if a dwelling is a house or an apartment, say), we call it a classification problem
How do we represent h?
Libear regression with one variable 线性回归模型
Univariate linear regression 一元线性回归
2.2 Cost Function 代价函数