supervised machine learning regression and classification week 2 answers

Practice quiz: Multiple linear regression

1. In the training set below, what is x 4 (3)? Please type in the number below (this is an integer such as 123, no decimal points).


2. Which of the following are potential benefits of vectorization? Please choose the best option.

  • It makes your code run faster
  • It can make your code shorter
  • It allows your code to run more easily on parallel compute hardware
  • All of the above

3. True/False? To make gradient descent converge about twice as fast, a technique that almost always works is to double the learning rate alpha.

  • True
  • False

Practice quiz: Gradient descent in practice

4. Which of the following is a valid step used during feature scaling?

  • Subtract the mean (average) from each value and then divide by the (max – min).
  • Add the mean (average) from each value and and then divide by the (max – min).

5. Suppose a friend ran gradient descent three separate times with three choices of the learning rate α and plotted the learning curves for each (cost J for each iteration).

For which case, A or B, was the learning rate � α likely too large?

  • case A only
  • Neither Case A nor B
  • Both Cases A and B
  • case B only

6. Of the circumstances below, for which one is feature scaling particularly helpful?

  • Feature scaling is helpful when one feature is much larger (or smaller) than another feature.
  • Feature scaling is helpful when all the features in the original data (before scaling is applied) range from 0 to 1.

7. You are helping a grocery store predict its revenue, and have data on its items sold per week, and price per item. What could be a useful engineered feature?

  • For each product, calculate the number of items sold divided by the price per item.
  • For each product, calculate the number of items sold times price per item.

8. True/False? With polynomial regression, the predicted values f_w,b(x) does not necessarily have to be a straight line (or linear) function of the input feature x.

  • False
  • True

Leave a Reply