Lab 8: Classification

Not graded, just practice

Author

Katie Schuler

Classification

  1. Which of the following aspects of model building apply to classification models? (Choose all that apply)
  1. What is the difference between regression and classification?
answer
"Regression predicts a continuous response varaible, 
classification predicts a discrete response variable"
  1. Which accuracy metric is best applied to classification models?
  1. In the figure below, which aspect shows the response variable?

  1. Which figure below could show a plotted classification model? Choose all that apply.

  1. Name two kinds of linear classifiers
answer
"Any 2 of those mentioned in class: 
Logistic regression
Linear discriminant analysis (LDA)
Linear support vector machines (SVM)
Nearest-prototype classifiers
Naive Bayes classifiers
"

4 Classification in R

  1. We can impliment classification via

  2. True or false, in R, we can perform logistic regression with a generalized linear model.

  1. What 3 elements do all GLMs have?
answer
"1. A particular distribution for modeling the response variable
2. A linear model 
3. A link function
"
  1. What is the link function for logistic regression?
  1. Which of the following fits a logistic regression model in R? Choose one.
# code A
glm(y ~ x, data = data, family = "binomial")

# code B
data %>%
    specify(y ~ x) %>%
    fit() 

# code C 
logistic_reg %>%
    set_engine("glm") %>%
    fit(y ~ x, data = data)