gpt4 book ai didi

python - R 或 Python 中的 CHAID 决策树

转载 作者:太空宇宙 更新时间:2023-11-03 11:48:54 26 4
gpt4 key购买 nike

我使用 SPSS 生成了 CHAID 树。它对连续变量进行自动分箱,并返回 R 的汇总函数中没有的卡方值和自由度。下面是部分示例输出。

    Node    0               1               Total        PC Parent  Variable    Sig.a   Chi-Square  df  Split Values
N Percent N Percent N Percent
0 148025 84.0% 28111 16.0% 176136 100.0% 0
1 102390 93.9% 6643 6.1% 109033 61.9% 0 0 SALES1 0.000 42991.370 4 <= .000
2 12600 91.3% 1194 8.7% 13794 7.8% 0 0 SALES1 0.000 42991.370 4 (.000,149.990]
3 15140 83.7% 2942 16.3% 18082 10.3% 0 0 SALES1 0.000 42991.370 4 (149.990,1044.000]

R 返回的是这样的:

https://stackoverflow.com/questions/32739093/what-are-the-available-chaid-summary-functions-in-r

我已经找到了利用树输出并像这个例子一样玩弄它的方法:

chaid regression tree to table conversion in r

是否有函数可以在 R 或 python 中获得 SPSS 类型的输出,或者必须全部使用 R 中的 partykit 包手动完成?

最佳答案

我最近用 python 为 CHAID 写了一个开源包 here

关于python - R 或 Python 中的 CHAID 决策树,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32942358/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com