Making binary predictions with regression

Apprendimento supervisionato in R: Classificazione

Brett Lantz

Instructor

Introducing linear regression

Scatterplot

Scatterplot with Regression Line

Apprendimento supervisionato in R: Classificazione

Regression for binary classification

Binary Scatterplot

Binary Scatterplot with Regression Line

Apprendimento supervisionato in R: Classificazione

Introducing logistic regression

Binary Scatterplot with Logistic Curve

Binary Scatterplot with Logistic Curve

Apprendimento supervisionato in R: Classificazione

Making predictions with logistic regression

Binary Scatterplot with Logistic Curve

m <- glm(y ~ x1 + x2 + x3,
           data = my_dataset,
           family = "binomial")

Predictions with Logistic Curve

prob <- predict(m, test_dataset,
          type = "response")
pred <- ifelse(prob > 0.50, 1, 0)
Apprendimento supervisionato in R: Classificazione

Let's practice!

Apprendimento supervisionato in R: Classificazione

Preparing Video For Download...