虚拟变量、缺失数据与交互项

R 中的监督学习:分类

Brett Lantz

Instructor

分类数据的虚拟编码

# create gender factor
my_data$gender <- factor(my_data$gender,
                         levels = c(0, 1, 2),
                         labels = c("Male", "Female", "Other"))
R 中的监督学习:分类

缺失数据填补

相同 AUC,不同 ROC

相同 AUC,不同 ROC

R 中的监督学习:分类

交互效应

相同 AUC,不同 ROC

相同 AUC,不同 ROC

# interaction of obesity and smoking
glm(disease ~ obesity * smoking,
      data = health,
      family = "binomial")
R 中的监督学习:分类

Let's practice!

R 中的监督学习:分类

Preparing Video For Download...