• 这是另一种决策树,我在做DRGs分组的时候用到了,记录下
  • wiki简介

  • CHAID:Chi-square automatic interaction detection

  • 这个算法基于adjusted significance testing(Bonferroni testing)
  • 同时,这个算法是AID和THAID的拓展,是G. V. Kass于1980年在《An Exploratory Technique for Investigating Large Quantities of Categorical Data》提出的

  • Select the predictor that has the smallest adjusted p-value (i.e., most significant). If this
    adjusted p-value is less than or equal to a user-specified alpha-level
    alpha4, split the node using this predictor. Else, do not split and the
    node is considered as a terminal node

R代码

  • 这里有两个R包
  • party
1
2
library(party)
fit = ctree(formula, data, controls = ctree_control())
  • CHAID
    • 只接受factorordered factor
    • 只能做分类树,不能做回归树。如果一定要用这个做,只能将连续性变量分类
1
2
3
library(partykit)
library(CHAID)
fit = chaid(formula, data = dat)

教程