CS229 Lecture notes
Andrew Ng
Supervised learning
监督学习
Lets start by talking about a few examples of supervised learning probliems.
Suppose we have a dataset giving the living areas and prices of 47 houses
from Portland, Oregon:
首先讨论一些例子关于监督学习.
假设我们有一个Porland地区47个关于住房面积与价格的数据集.
We can plot this data:
我们可以画出这些数据
Given data like this, how can we learn to predict the prices of other houses
in Portland, as a function of the size of their living areas?
给定数据如上, 怎么才能学习一个方法在Portland地区根据居住面积预测房屋价格?
To establish notation for future use, we'll use x^{(i)} to denote the "input"
variables (living area in this example), also called input features, and y^{(i)}
to denote the "output" or target variable that we are trying to predict (price).
A pair (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,\cdots,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. We
will also use X denote the space of input values, and Y the space of output values.
In this example, X = Y = R.
建立将来所要适用的符号, 我们使用 x^{(i)} 来表示“输入”变量(例中居住面积),
也成为输入特征, 并且 y^{(i)} 表示我们尝试预测(价格)的“输出” 或目标变量.
一对 (x^{(i)},y^{(i)}) 称为一个训练样本, 并且我们将用作学习的 含m 个训练样例
列表的数据集成为训练集. 注意上标 "(i)" 符号在训练集里是一个简单的索引, 并没有
指数的意思. 我们也将使用 X 表示输入变量空间, 且 Y 是输出变量空间.
在这个例子中 X = Y = R
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:
稍微正式的描述监督学习问题, 我们的目标是从给定的训练集中学习一个
函数 h : X -> Y 那么 h(x) 是一个 “好的” 预测器,得出相应值y. 由于历史原因
这个函数 h 成为假设. 形象的看出过程是这样的:
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 small number of discrete values ( sicj 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.