machine learning with python ibm coursera quiz answers week 2

Practice Quiz: Regression

1. Which of the following is the meaning of "Out of Sample Accuracy" in the context of evaluation of models?

  • โ€œOut of Sample Accuracyโ€ is the accuracy of an overly trained model (which may capture noise and produced a non-generalized model)
  • โ€œOut of Sample Accuracyโ€ is the accuracy of a model on all the data available.
  • โ€œOut of Sample Accuracyโ€ is the percentage of correct predictions that the model makes using the test dataset.
  • โ€œOut of Sample Accuracyโ€ is the percentage of correct predictions that the model makes on data that the model has NOT been trained on.

2. When should we use Multiple Linear Regression? (Select two)

  • When we would like to examine the relationship between multiple variables.
  • When we would like to predict impacts of changes in independent variables on a dependent variable.
  • When there are multiple dependent variables
  • When we would like to identify the strength of the effect that the independent variables have on a dependent variable.

3. Which sentence is TRUE about linear regression?

  • A linear relationship is necessary between the independent and dependent variables as well as in between independent variables.
  • A linear relationship is necessary between the independent variables and the dependent variable.
  • Simple linear regression requires a linear relationship between the predictor and the response, but multiple linear regression does not.
  • Multiple linear regression requires a linear relationship between the predictors and the response, but simple linear regression does not.

Graded Quiz: Regression

4. What are the requirements for independent and dependent variables in regression?

  • Independent variables can be either categorical or continuous. Dependent variables must be continuous.
  • Independent variables must be continuous. Dependent variables can be either categorical or continuous.
  • Independent and dependent variables can be either categorical or continuous.
  • Independent and dependent variables must be continuous.

5. The key difference between simple and multiple regression is:

  • To estimate a single dependent variable, simple regression uses one independent variable whereas multiple regression uses multiple.
  • Simple linear regression compresses multidimensional space into one dimension.
  • Simple regression assumes a linear relationship between variables, whereas this assumption is not necessary for multiple regression.
  • Multiple linear regression introduces polynomial features.

6. Recall that we tried to predict CO2 emission with car information. Say that now we can describe the relationship as: CO2_emission = 130 - 2.4*cylinders + 8.3*fuel_consumption

What is TRUE of this relationship?

  • When โ€œcylindersโ€ decreases by 1 while fuel_consumption remains constant, CO2_emission increases by 2.4 units.
  • When โ€œcylindersโ€ increases by 1 while fuel_consumption remains constant, CO2_emission increases by 2.4 units.
  • Since the coefficient for โ€œfuel_consumptionโ€ is greater than that for โ€œcylindersโ€, โ€œfuel_consumptionโ€ has higher impact on CO2_emission.
  • When both โ€œcylindersโ€ and โ€œfuel_consumptionโ€ increase by 1 unit, CO2_emission decreases.

7. What could be the cause of a model yielding high training accuracy and low out-of-sample accuracy?

  • The model is training on the entire dataset, so it is underfitting.
  • The model is training on the entire dataset, so it is overfitting.
  • The model is training on a small training set, so it is underfitting.
  • The model is training on a small training set, so it is overfitting.

8. Multiple Linear Regression is appropriate for:

  • Predicting the sales amount based on month.
  • Predicting tomorrowโ€™s rainfall amount based on the wind speed and temperature.
  • Predicting whether a drug is effective for a patient based on her characteristics.

Leave a Reply