机器学习测试Week1_2_Linear Regression with One Variable
Week 1 | 1_Linear Regression with One Variable
第 1 题
Consider the problem of predicting how well a student does in her second year of college/university, given how well she did in her first year.
Specifically, let x be equal to the number of “A” grades (including A-. A and A+ grades) that a student receives in their first year of college (freshmen year). We would like to predict the value of y, which we define as the number of “A” grades they get in their second year (sophomore year).
Here each row is one training example. Recall that in linear regression, our hypothesis is
x | y |
---|---|
3 | 2 |
1 | 2 |
0 | 1 |
4 | 3 |
For the training set given above (note that this training set may also be referenced in other questions in this quiz), what is the value of
** 答案: 4
解析: m=Number of traing examples,有几个样本,4个 **
第 2 题
For this question, assume that we are using the training set from Q1. Recall our definition of the cost function was
What is
** 答案: 0.5
解析:
第 3 题
Suppose we set
** 答案: 1
解析:
第 4 题
In the given figure, the cost function
- If we start from point B, gradient descent with a well-chosen learning rate will eventually help us reach at or near point A, as the value of cost function
J(θ0,θ1) is minimum at A. - Point P (The global minimum of plot 2) corresponds to point C of Plot 1.
- If we start from point B, gradient descent with a well-chosen learning rate will eventually help us reach at or near point C, as the value of cost function
J(θ0,θ1) is minimum at point C. - If we start from point B, gradient descent with a well-chosen learning rate will eventually help us reach at or near point A, as the value of cost function
J(θ0,θ1) is maximum at point A. - Point P (the global minimum of plot 2) corresponds to point A of Plot 1.
** 答案: A D
解析: 从B开始使用梯度下降算法最终会收敛到A点,所以选A而不选C
P点是一个全局最小值,全局最小值在等高线上是中心A, 而不是边缘上的C, 所以选D而不选B **
第 5 题
Suppose that for some linear regression problem (say, predicting housing prices as in the lecture), we have some training set, and for our training set we managed to find some
Which of the statements below must then be true? (Check all that apply.)
For this to be true, we must have
θ0=0 andθ1=0 so thathθ(x)=0 For these values of
θ0 andθ1 that satisfyJ(θ0,θ1)=0
we have thathθ(x(i))=y(i) for every training example(x(i),y(i)) This is not possible: By the definition of
J(θ0,θ1)=0 , it is not possible for there to existθ0 andθ1 so thatJ(θ0,θ1)=0 We can perfectly predict the value of y even for new examples that we have not yet seen.
(e.g., we can perfectly predict prices of even new houses that we have not yet seen.)
** 答案: B
解析:
选项1: 我们的目的是找到
选项2: 当完全拟合时,就会出现损失函数为0的情况. 正确
选项3: B与C说法正好相反. 当完全拟合时,就会出现损失函数为0的情况
选项4: 我们可以预测但是肯定会有一些情况下会有误差.用大体上估计,差不多等词是可以的,但不能perfectly predict
**