Supervised Learning in R: Classification
Brett Lantz
Instructor
# create gender factor
my_data$gender <- factor(my_data$gender,
levels = c(0, 1, 2),
labels = c("Male", "Female", "Other"))
# interaction of obesity and smoking
glm(disease ~ obesity * smoking,
data = health,
family = "binomial")
Supervised Learning in R: Classification