虛擬變數、遺漏值與交互作用

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 監督式學習:分類

一起來練習吧!

R 監督式學習:分類

Preparing Video For Download...