supervised machine learning regression and classification week 3 answers
Practice quiz: Classification with logistic regression
1. Which is an example of a classification task?
- Based on a patient’s blood pressure, determine how much blood pressure medication (a dosage measured in milligrams) the patient should be prescribed.
- Based on the size of each tumor, determine if each tumor is malignant (cancerous) or not.
- Based on a patient’s age and blood pressure, determine how much blood pressure medication (measured in milligrams) the patient should be prescribed.
2. Recall the sigmoid function is g(z) = 1/1+e-z
If z is a large positive number, then:
- g(z) will be near zero (0)
- g(z) is near one (1)
- g(z) will be near 0.5
- g(z) is near negative one (-1)
3. A cat photo classification model predicts 1 if it's a cat, and 0 if it's not a cat. For a particular photograph, the logistic regression model outputs g(z) (a number between 0 and 1). Which of these would be a reasonable criteria to decide whether to predict if it’s a cat?
- Predict it is a cat if g(z) = 0.5
- Predict it is a cat if g(z) < 0.7
- Predict it is a cat if g(z) < 0.5
- Predict it is a cat if g(z) >= 0.5
4. True/False? No matter what features you use (including if you use polynomial features), the decision boundary learned by logistic regression will be a linear decision boundary.
- True
- False
Practice quiz: Cost function for logistic regression
5. In this lecture series, "cost" and "loss" have distinct meanings. Which one applies to a single training example?
- Loss
- Cost
- Both Loss and Cost
- Neither Loss nor Cost
6. For the simplified loss function, if the label y (i) = 0, then what does this expression simplify to?
Practice quiz: Gradient descent for logistic regression
7. Which of the following two statements is a more accurate statement about gradient descent for logistic regression?
- The update steps look like the update steps for linear regression, but the definition of fw,b(x(i)) is different.
- The update steps are identical to the update steps for linear regression.
Practice quiz: The problem of overfitting
8. Which of the following can address overfitting?
- Select a subset of the more relevant features.
- Collect more training data
- Apply regularization
- Remove a random set of training examples
9. You fit logistic regression with polynomial features to a dataset, and your model looks like this.
What would you conclude? (Pick one)
- The model has high variance (overfit). Thus, adding data is, by itself, unlikely to help much.
- The model has high bias (underfit). Thus, adding data is, by itself, unlikely to help much.
- The model has high variance (overfit). Thus, adding data is likely to help
- The model has high bias (underfit). Thus, adding data is likely to help
10. Suppose you have a regularized linear regression model. If you increase the regularization parameter λ, what do you expect to happen to the parameters w1 ,w2 ,...,wn ?
- This will reduce the size of the parameters w 1 ​ ,w 2 ​ ,…,w n ​
- This will increase the size of the parameters w 1 ​ ,w 2 ​ ,…,w n ​