Consider the problem of predicting how well a student does in her second year of college/university, given how well they did in their 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).
Questions 1 through 4 will use the following training set of a small sample of different students‘ performances. Here each row is one training example. Recall that in linear regression, our hypothesis is $hθ(x)=θ_0+θ_1x$, and we use m to denote the number of training examples.
x | y |
---|---|
5 | 4 |
3 | 4 |
0 | 1 |
4 | 3 |
For the training set given above, what is the value of m? In the box below, please enter your answer (which should be a number between 0 and 10).
m is the number of training examples. In this example, we have m=4 examples.
4
Many substances that can burn (such as gasoline and alcohol) have a chemical structure based on carbon atoms; for this reason they are called hydrocarbons. A chemist wants to understand how the number of carbon atoms in a molecule affects how much energy is released when that molecule combusts (meaning that it is burned). The chemists obtains the dataset below. In the column on the right, “kJ/mol” is the unit measuring the amount of energy released. examples.
You would like to use linear regression (hθ(x)=θ_0+θ_1x) to estimate the amount of energy released (y) as a function of the number of carbon atoms (x). Which of the following do you think will be the values you obtain for θ_0 and θ_1? You should be able to select the right answer without actually implementing linear regression.
Since the carbon atoms (x) increase and the released heat (y) decreases, θ_1 has to be negative. θ_0 functionas as the offset. Looking at the table: a few θ_0 should be higher than -1000
Question Explanation
We can give an approximate estimate of the θ0 and θ1 values observing the trend of the data in the training set. We see that the y values decrease quite regularly when the x values increase, then θ1 must be negative. θ0 is the value that the hypothesis takes when x is equal to zero, therefore it must be superior to y(1) in order to satisfy the decreasing trend of the data. Among the proposed answers, the only one that meets both the conditions is hθ(x)=−569.6−530.9x. We can better appreciate these considerations observing the graph of the training data and the linear regression (below):
Suppose we set θ_0=−1,θ_1=0.5. What is hθ(4)?
hθ(x) = θ_0 + θ_1x
hθ(x) = -1 + 0.5x
hθ(4) = -1 + 0.5 * 4
hθ_θ(4) = 1
Let f be some function so that f(θ0,θ1) outputs a number. For this problem, f is some arbitrary/unknown smooth function (not necessarily the cost function of linear regression, so f may have local optima). Suppose we use gradient descent to try to minimize f(θ0,θ1) as a function of θ0 and θ1. Which of the following statements are true? (Check all that apply.)
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 θ0, θ1 such that J(θ0,θ1)=0. Which of the statements below must then be true? (Check all that apply.)
【Coursera - machine learning】 Linear regression with one variable-quiz
原文:http://www.cnblogs.com/Patrick-L/p/5830981.html