8 Yes, no, or maybe so? Logistic regression and classification
This chapter covers
- What classification models are and how they are different from regressions
- How to perform a logistic regression and validate classification models
- The machine learning workflow and how it differs from traditional statistics
Classifying is choosing a label for something, like whether an email is spam or not spam, or whether an image contains a dog, cat, or bird. When we are trying to classify a prediction or outcome, we are not predicting a continuous value (e.g., 103.5 degrees Fahrenheit) but rather a binary (spam/not spam) or multiple-choice (dog/cat/bird) outcome. We also call this problem categorical or a form of classification. A model like linear regression is not necessarily equipped for this type of problem, because we need a qualitative value (e.g., is this email spam?) from a limited set of values (spam or not spam). In this chapter, we will emphasize examples with binary classification (e.g., spam or not spam). Although these techniques lend themselves to modeling multiple classes too (e.g., dog/cat/bird), they are outside the scope of this book.