R 中的监督学习:分类
Brett Lantz
Instructor
m <- glm(y ~ x1 + x2 + x3, data = my_dataset, family = "binomial")
prob <- predict(m, test_dataset, type = "response")
pred <- ifelse(prob > 0.50, 1, 0)